Use dbus activation to start the presence service
This commit is contained in:
parent
e2e5bc0000
commit
c7c71d25a8
@ -231,6 +231,9 @@ class PresenceServiceDBusHelper(dbus.service.Object):
|
|||||||
def unregisterServiceType(self, stype):
|
def unregisterServiceType(self, stype):
|
||||||
self._parent.unregister_service_type(stype)
|
self._parent.unregister_service_type(stype)
|
||||||
|
|
||||||
|
@dbus.service.method(_PRESENCE_DBUS_INTERFACE)
|
||||||
|
def start(self):
|
||||||
|
self._parent.start()
|
||||||
|
|
||||||
class PresenceService(object):
|
class PresenceService(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -262,6 +265,7 @@ class PresenceService(object):
|
|||||||
self._bus_name = dbus.service.BusName(_PRESENCE_SERVICE, bus=self._session_bus)
|
self._bus_name = dbus.service.BusName(_PRESENCE_SERVICE, bus=self._session_bus)
|
||||||
self._dbus_helper = PresenceServiceDBusHelper(self, self._bus_name)
|
self._dbus_helper = PresenceServiceDBusHelper(self, self._bus_name)
|
||||||
|
|
||||||
|
def start(self):
|
||||||
# Connect to Avahi for mDNS stuff
|
# Connect to Avahi for mDNS stuff
|
||||||
self._system_bus = dbus.SystemBus()
|
self._system_bus = dbus.SystemBus()
|
||||||
self._mdns_service = dbus.Interface(self._system_bus.get_object(avahi.DBUS_NAME,
|
self._mdns_service = dbus.Interface(self._system_bus.get_object(avahi.DBUS_NAME,
|
||||||
|
@ -55,7 +55,9 @@ class Session:
|
|||||||
process.start()
|
process.start()
|
||||||
|
|
||||||
console = ConsoleWindow()
|
console = ConsoleWindow()
|
||||||
#sugar.logger.start('Shell', console)
|
sugar.logger.start('Shell', console)
|
||||||
|
|
||||||
|
PresenceService.start()
|
||||||
|
|
||||||
process = MatchboxProcess()
|
process = MatchboxProcess()
|
||||||
process.start()
|
process.start()
|
||||||
|
@ -205,3 +205,8 @@ class PresenceService(gobject.GObject):
|
|||||||
|
|
||||||
def unregister_service_type(self, stype):
|
def unregister_service_type(self, stype):
|
||||||
self._ps.unregisterServiceType(stype)
|
self._ps.unregisterServiceType(stype)
|
||||||
|
|
||||||
|
def start():
|
||||||
|
bus = dbus.SessionBus()
|
||||||
|
ps = dbus.Interface(bus.get_object(DBUS_SERVICE, DBUS_PATH), DBUS_INTERFACE)
|
||||||
|
ps.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user