mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
fix #647
This commit is contained in:
parent
7d781568ea
commit
e0fc7f3d2e
1 changed files with 3 additions and 12 deletions
|
@ -37,6 +37,7 @@
|
||||||
import os
|
import os
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import deluge
|
import deluge
|
||||||
|
@ -48,11 +49,6 @@ import deluge.pref
|
||||||
|
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
import platform
|
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.
|
if platform.system() == "Linux": # Add this, FreeBSD and other OSs than Linux do not have /etc/issue.
|
||||||
print "checking for ubuntu..."
|
print "checking for ubuntu..."
|
||||||
if os.WEXITSTATUS(os.system('grep -iq "Ubuntu" /etc/issue')) == 0:
|
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"
|
print "found and fixing ubuntu"
|
||||||
os.environ["MOZILLA_FIVE_HOME"] = "/usr/lib/firefox"
|
os.environ["MOZILLA_FIVE_HOME"] = "/usr/lib/firefox"
|
||||||
os.environ["LD_LIBRARY_PATH"] = "/usr/lib/firefox"
|
os.environ["LD_LIBRARY_PATH"] = "/usr/lib/firefox"
|
||||||
os.system("/usr/bin/deluge %s &" % arguments)
|
subprocess.Popen(sys.argv)
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
parser = OptionParser(usage="%prog [options] [torrents to add]",
|
parser = OptionParser(usage="%prog [options] [torrents to add]",
|
||||||
|
@ -136,12 +132,7 @@ try:
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
except:
|
except:
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
while i < len(sys.argv):
|
subprocess.Popen(["dbus-launch", "deluge"] + sys.argv[1:])
|
||||||
arguments = arguments + " " + sys.argv[i]
|
|
||||||
i+=1
|
|
||||||
pid = os.fork()
|
|
||||||
if not pid:
|
|
||||||
os.popen('dbus-launch deluge %s' %arguments)
|
|
||||||
else:
|
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()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue