mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +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
1 changed files with 2 additions and 11 deletions
|
@ -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…
Add table
Reference in a new issue