Use dbus activation to start the presence service

This commit is contained in:
Marco Pesenti Gritti 2006-08-13 00:28:38 +02:00
parent e2e5bc0000
commit c7c71d25a8
3 changed files with 12 additions and 1 deletions

View File

@ -231,6 +231,9 @@ class PresenceServiceDBusHelper(dbus.service.Object):
def unregisterServiceType(self, stype):
self._parent.unregister_service_type(stype)
@dbus.service.method(_PRESENCE_DBUS_INTERFACE)
def start(self):
self._parent.start()
class PresenceService(object):
def __init__(self):
@ -262,6 +265,7 @@ class PresenceService(object):
self._bus_name = dbus.service.BusName(_PRESENCE_SERVICE, bus=self._session_bus)
self._dbus_helper = PresenceServiceDBusHelper(self, self._bus_name)
def start(self):
# Connect to Avahi for mDNS stuff
self._system_bus = dbus.SystemBus()
self._mdns_service = dbus.Interface(self._system_bus.get_object(avahi.DBUS_NAME,

View File

@ -55,7 +55,9 @@ class Session:
process.start()
console = ConsoleWindow()
#sugar.logger.start('Shell', console)
sugar.logger.start('Shell', console)
PresenceService.start()
process = MatchboxProcess()
process.start()

View File

@ -205,3 +205,8 @@ class PresenceService(gobject.GObject):
def unregister_service_type(self, stype):
self._ps.unregisterServiceType(stype)
def start():
bus = dbus.SessionBus()
ps = dbus.Interface(bus.get_object(DBUS_SERVICE, DBUS_PATH), DBUS_INTERFACE)
ps.start()