[lorien420] try to start notif-daemon if not there

This commit is contained in:
Nikos Kouremenos 2005-11-23 17:44:32 +00:00
parent e0ba19f93c
commit 64f2ef7d0e
1 changed files with 10 additions and 4 deletions

View File

@ -47,10 +47,16 @@ def dbus_get_interface():
bus = dbus.SessionBus()
obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
#FIXME: this just disables notification-daemon for 99% of users
#avail = dbus_iface.ListNames()
#if not interface in avail:
# return None
running_services = dbus_iface.ListNames()
started = True
if interface not in running_services:
# try to start the service (notif-daemon)
if dbus_iface.StartServiceByName(interface,dbus.UInt32(0)) == 1:
started = True
else:
started = False
if not started:
return None
obj = bus.get_object(interface, path)
return dbus.Interface(obj, interface)
except Exception, e: