This commit is contained in:
Marcos Pinto 2008-01-07 23:25:10 +00:00
parent 7d781568ea
commit e0fc7f3d2e
1 changed files with 3 additions and 12 deletions

View File

@ -37,6 +37,7 @@
import os
from optparse import OptionParser
import re
import subprocess
import sys
import deluge
@ -48,11 +49,6 @@ import deluge.pref
if not deluge.common.windows_check():
import platform
i = 1
arguments = ""
while i < len(sys.argv):
arguments = arguments + " " + sys.argv[i]
i+=1
if platform.system() == "Linux": # Add this, FreeBSD and other OSs than Linux do not have /etc/issue.
print "checking for ubuntu..."
if os.WEXITSTATUS(os.system('grep -iq "Ubuntu" /etc/issue')) == 0:
@ -60,7 +56,7 @@ if not deluge.common.windows_check():
print "found and fixing ubuntu"
os.environ["MOZILLA_FIVE_HOME"] = "/usr/lib/firefox"
os.environ["LD_LIBRARY_PATH"] = "/usr/lib/firefox"
os.system("/usr/bin/deluge %s &" % arguments)
subprocess.Popen(sys.argv)
raise SystemExit
parser = OptionParser(usage="%prog [options] [torrents to add]",
@ -136,12 +132,7 @@ try:
bus = dbus.SessionBus()
except:
if not deluge.common.windows_check():
while i < len(sys.argv):
arguments = arguments + " " + sys.argv[i]
i+=1
pid = os.fork()
if not pid:
os.popen('dbus-launch deluge %s' %arguments)
subprocess.Popen(["dbus-launch", "deluge"] + sys.argv[1:])
else:
dbus_objects = dbus.Interface(bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus').ListNames()