Skip to content

Commit

Permalink
some reformatting; qt restored in own package
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Dec 27, 2023
1 parent b495e99 commit e32187f
Show file tree
Hide file tree
Showing 2 changed files with 417 additions and 14 deletions.
18 changes: 4 additions & 14 deletions apprise/plugins/NotifyDBus.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
# library available to us (or maybe one we don't support)?
pass

# Define our supported protocols.
PROTOCOLS_LIST = ('qt', 'kde', 'glib', 'dbus')


# Urgencies
class DBusUrgency:
Expand Down Expand Up @@ -123,7 +120,7 @@ class NotifyDBus(NotifyBase):

requirements = {
# Define our required packaging in order to work
'details': _('libdbus-1.so.x must be installed.')
'details': _('libdbus-1.so.x or libdbus-2.so.x must be installed.')
}

# The default descriptive name associated with the Notification
Expand All @@ -133,7 +130,7 @@ class NotifyDBus(NotifyBase):
service_url = 'http://www.freedesktop.org/Software/dbus/'

# The default protocols
protocol = list(PROTOCOLS_LIST)
protocol = ('glib', 'dbus')

# A URL that takes you to the setup/help of the specific protocol
setup_url = 'https://github.com/caronc/apprise/wiki/Notify_dbus'
Expand Down Expand Up @@ -205,14 +202,6 @@ def __init__(self, urgency=None, x_axis=None, y_axis=None,
# Track our notifications
self.registry = {}

# Store our schema; default to dbus
self.schema = kwargs.get('schema', 'dbus')

if self.schema not in PROTOCOLS_LIST:
msg = f'The schema specified ({self.schema}) is not supported.'
self.logger.warning(msg)
raise TypeError(msg)

# The urgency of the message
self.urgency = int(
NotifyDBus.template_args['urgency']['default']
Expand Down Expand Up @@ -365,7 +354,8 @@ def url(self, privacy=False, *args, **kwargs):
if self.y_axis:
params['y'] = str(self.y_axis)

return f'{self.schema}://_/?{NotifyDBus.urlencode(params)}'
schema = self.protocol[0]
return f'{schema}://_/?{NotifyDBus.urlencode(params)}'

@staticmethod
def parse_url(url):
Expand Down
Loading

0 comments on commit e32187f

Please sign in to comment.