Set DBUS default loop
authorKonstantin Stepanov <kstep@p-nut.info>
Sun, 17 Oct 2010 20:22:25 +0000 (23:22 +0300)
committerKonstantin Stepanov <kstep@p-nut.info>
Sun, 17 Oct 2010 20:22:25 +0000 (23:22 +0300)
dbuscron/bus.py

index f82cb21..53ced84 100644 (file)
@@ -14,6 +14,10 @@ class DbusBus(object):
             cls.__bus = super(DbusBus, cls).__new__(cls)
         return cls.__bus
 
+    def __init__(self):
+        from dbus.mainloop.glib import DBusGMainLoop
+        DBusGMainLoop(set_as_default=True)
+
     @property
     def system(self):
         if not self.__system_bus: