Don't allow PS to be started twice

This commit is contained in:
Dan Williams 2006-08-16 12:09:43 -04:00
parent 2a50bbd3ca
commit 9ad1fe62ae

View File

@ -265,7 +265,13 @@ 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)
self._started = False
def start(self): def start(self):
if self._started:
return
self._started = True
# 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,