mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 04:54:23 +00:00
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.
This commit is contained in:
parent
b4903b763e
commit
0b5b585992
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user