Skip to content

Commit b0fff4b

Browse files
authored
Dbus/Glib Python binding update + test refactoring (#1377)
1 parent 18255eb commit b0fff4b

4 files changed

Lines changed: 900 additions & 133 deletions

File tree

apprise/plugins/dbus.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@
4444

4545

4646
try:
47-
# dbus essentials
47+
# D-Bus Message Bus Daemon 1.12.XX Essentials
4848
from dbus import Byte, ByteArray, DBusException, Interface, SessionBus
4949

5050
#
5151
# now we try to determine which mainloop(s) we can access
5252
#
5353

54-
# glib
54+
# glib/dbus
5555
try:
5656
from dbus.mainloop.glib import DBusGMainLoop
57-
5857
LOOP_GLIB = DBusGMainLoop()
5958

6059
except ImportError: # pragma: no cover
@@ -64,7 +63,6 @@
6463
# qt
6564
try:
6665
from dbus.mainloop.qt import DBusQtMainLoop
67-
6866
LOOP_QT = DBusQtMainLoop(set_as_default=True)
6967

7068
except ImportError:
@@ -84,10 +82,8 @@
8482
try:
8583
# The following is required for Image/Icon loading only
8684
import gi
87-
8885
gi.require_version("GdkPixbuf", "2.0")
8986
from gi.repository import GdkPixbuf
90-
9187
NOTIFY_DBUS_IMAGE_SUPPORT = True
9288

9389
except (ImportError, ValueError, AttributeError):
@@ -109,7 +105,6 @@
109105
MAINLOOP_MAP = {
110106
"qt": LOOP_QT,
111107
"kde": LOOP_QT,
112-
"glib": LOOP_GLIB,
113108
"dbus": LOOP_QT if LOOP_QT else LOOP_GLIB,
114109
}
115110

@@ -139,6 +134,7 @@ class DBusUrgency:
139134
"h": DBusUrgency.HIGH,
140135
# Maps against string 'emergency'
141136
"e": DBusUrgency.HIGH,
137+
142138
# Entries to additionally support (so more like DBus's API)
143139
"0": DBusUrgency.LOW,
144140
"1": DBusUrgency.NORMAL,

0 commit comments

Comments
 (0)