deal with stupid gutsy sometimes not being able to connect to dbus

This commit is contained in:
Marcos Pinto 2007-11-22 22:26:06 +00:00
commit bb03e2ff6a

View file

@ -113,7 +113,14 @@ def start_deluge():
interface = deluge.interface.DelugeGTK() interface = deluge.interface.DelugeGTK()
interface.start(get_cmd_line_torrents()) interface.start(get_cmd_line_torrents())
try:
bus = dbus.SessionBus() bus = dbus.SessionBus()
except:
if not deluge.common.windows_check():
pid = os.fork()
if not pid:
os.popen('dbus-launch deluge')
else:
dbus_objects = dbus.Interface(bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus').ListNames() dbus_objects = dbus.Interface(bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus').ListNames()
if not "org.deluge_torrent.Deluge" in dbus_objects: if not "org.deluge_torrent.Deluge" in dbus_objects: