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:
Simon McVittie 2007-05-24 15:38:54 +01:00
parent 2abcd89c1f
commit 570a485d84

View File

@ -18,11 +18,9 @@ import gobject
import dbus
import dbus.service
from dbus.gobject_service import ExportedGObject
from dbus.mainloop.glib import DBusGMainLoop
import logging
# Note that this import has side effects!
import dbus.glib
from telepathy.client import ManagerRegistry, Connection
from telepathy.interfaces import (CONN_MGR_INTERFACE, CONN_INTERFACE)
from telepathy.constants import (CONNECTION_STATUS_CONNECTING,
@ -422,6 +420,7 @@ class PresenceService(ExportedGObject):
def main(test_num=0, randomize=False):
loop = gobject.MainLoop()
dbus_mainloop_wrapper = DBusGMainLoop(set_as_default=True)
if test_num > 0:
from pstest import TestPresenceService