diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2012-11-30 14:44:05 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2012-11-30 16:04:15 +0000 |
commit | 0b5b585992323454f36e89a7c189d4e32b3857fe (patch) | |
tree | 7a328ffe6e79185fb092c1bf369c5912b5a2f816 /deluge/ui/client.py | |
parent | b4903b763e4c9b60adb9fbee1b2fa85152a487e2 (diff) | |
download | deluge-0b5b585992323454f36e89a7c189d4e32b3857fe.tar.gz deluge-0b5b585992323454f36e89a7c189d4e32b3857fe.tar.bz2 deluge-0b5b585992323454f36e89a7c189d4e32b3857fe.zip |
Replace subprocess.call with subprocess.Popen to start deluged from gtk client
The use of Popen was originally a fix for a Win32 issue on 1.3 but makes sense to
apply to all OSs and simplify code.
Diffstat (limited to 'deluge/ui/client.py')
-rw-r--r-- | deluge/ui/client.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 3feba4c57..cf9dee85f 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -37,17 +37,13 @@ import logging from twisted.internet.protocol import ClientFactory from twisted.internet import reactor, ssl, defer +import subprocess import deluge.common from deluge import error from deluge.event import known_events from deluge.transfer import DelugeTransferProtocol -if deluge.common.windows_check(): - import win32api -else: - import subprocess - RPC_RESPONSE = 1 RPC_ERROR = 2 RPC_EVENT = 3 @@ -629,12 +625,7 @@ class Client(object): """ try: - if deluge.common.windows_check(): - win32api.WinExec("deluged --port=%s --config=\"%s\"" % (port, config)) - elif deluge.common.osx_check(): - subprocess.call(["nohup", "deluged", "--port=%s" % port, "--config=%s" % config]) - else: - subprocess.call(["deluged", "--port=%s" % port, "--config=%s" % config]) + subprocess.Popen(["deluged", "--port=%s" % port, "--config=%s" % config]) except OSError, e: from errno import ENOENT if e.errno == ENOENT: |