From e0fc7f3d2e90c366cc2a207ebd51e1dc11462608 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Mon, 7 Jan 2008 23:25:10 +0000 Subject: [PATCH] fix #647 --- scripts/deluge | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/deluge b/scripts/deluge index 962879d54..a0cab182d 100755 --- a/scripts/deluge +++ b/scripts/deluge @@ -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()