Convert PS bindings instantiation into a singleton to cut resource usage

This commit is contained in:
Dan Williams
2006-08-23 11:38:56 -04:00
parent d334b6e3bd
commit eef5e5b18a
7 changed files with 18 additions and 10 deletions
+8
View File
@@ -206,6 +206,14 @@ class PresenceService(gobject.GObject):
def unregister_service_type(self, stype):
self._ps.unregisterServiceType(stype)
_ps = None
def get_instance():
global _ps
if not _ps:
_ps = PresenceService()
return _ps
def start():
bus = dbus.SessionBus()
ps = dbus.Interface(bus.get_object(DBUS_SERVICE, DBUS_PATH), DBUS_INTERFACE)