services/presence/presenceservice: don't use deprecated dbus.glib
Importing dbus.glib has strange magical side-effects. Instead, make it more explicit that the default dbus-python main loop is being set to the GLib main loop.
This commit is contained in:
parent
2abcd89c1f
commit
570a485d84
@ -18,11 +18,9 @@ import gobject
|
|||||||
import dbus
|
import dbus
|
||||||
import dbus.service
|
import dbus.service
|
||||||
from dbus.gobject_service import ExportedGObject
|
from dbus.gobject_service import ExportedGObject
|
||||||
|
from dbus.mainloop.glib import DBusGMainLoop
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Note that this import has side effects!
|
|
||||||
import dbus.glib
|
|
||||||
|
|
||||||
from telepathy.client import ManagerRegistry, Connection
|
from telepathy.client import ManagerRegistry, Connection
|
||||||
from telepathy.interfaces import (CONN_MGR_INTERFACE, CONN_INTERFACE)
|
from telepathy.interfaces import (CONN_MGR_INTERFACE, CONN_INTERFACE)
|
||||||
from telepathy.constants import (CONNECTION_STATUS_CONNECTING,
|
from telepathy.constants import (CONNECTION_STATUS_CONNECTING,
|
||||||
@ -422,6 +420,7 @@ class PresenceService(ExportedGObject):
|
|||||||
|
|
||||||
def main(test_num=0, randomize=False):
|
def main(test_num=0, randomize=False):
|
||||||
loop = gobject.MainLoop()
|
loop = gobject.MainLoop()
|
||||||
|
dbus_mainloop_wrapper = DBusGMainLoop(set_as_default=True)
|
||||||
|
|
||||||
if test_num > 0:
|
if test_num > 0:
|
||||||
from pstest import TestPresenceService
|
from pstest import TestPresenceService
|
||||||
|
Loading…
Reference in New Issue
Block a user