mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-20 07:08:30 +00:00
Try to fix daemon starting in windows
This commit is contained in:
parent
4d46faf014
commit
19a2ae45e9
@ -124,6 +124,14 @@ def start_daemon():
|
|||||||
else:
|
else:
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
if deluge.common.windows_check() and not options.donot:
|
||||||
|
port = 58846
|
||||||
|
if options.port:
|
||||||
|
port = options.port
|
||||||
|
import subprocess
|
||||||
|
subprocess.Popen(["deluged", "-p %s" % port])
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
from deluge.core.daemon import Daemon
|
from deluge.core.daemon import Daemon
|
||||||
Daemon(options, args)
|
Daemon(options, args)
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import pkg_resources
|
|||||||
import gobject
|
import gobject
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ class ConnectionManager(component.Component):
|
|||||||
# If classic mode is set, we just start up a localhost daemon and connect to it
|
# If classic mode is set, we just start up a localhost daemon and connect to it
|
||||||
if self.gtkui_config["classic_mode"]:
|
if self.gtkui_config["classic_mode"]:
|
||||||
uri = "http://localhost:58846"
|
uri = "http://localhost:58846"
|
||||||
os.spawnlp(os.P_NOWAIT, "deluged", "-p", "58846")
|
subprocess.Popen(["deluged", "-p 58846"])
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
# We need to wait for the host to start before connecting
|
# We need to wait for the host to start before connecting
|
||||||
while not self.test_online_status(uri):
|
while not self.test_online_status(uri):
|
||||||
@ -152,7 +153,7 @@ class ConnectionManager(component.Component):
|
|||||||
port = uri[7:].split(":")[1]
|
port = uri[7:].split(":")[1]
|
||||||
# First add it to the list
|
# First add it to the list
|
||||||
self.add_host("localhost", port)
|
self.add_host("localhost", port)
|
||||||
os.spawnlp(os.P_NOWAIT, "deluged", "-p", port)
|
subprocess.Popen(["deluged", "-p %s" % port])
|
||||||
# We need to wait for the host to start before connecting
|
# We need to wait for the host to start before connecting
|
||||||
while not self.test_online_status(uri):
|
while not self.test_online_status(uri):
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
@ -424,7 +425,7 @@ class ConnectionManager(component.Component):
|
|||||||
port = str(port)
|
port = str(port)
|
||||||
log.info("Starting localhost:%s daemon..", port)
|
log.info("Starting localhost:%s daemon..", port)
|
||||||
# Spawn a local daemon
|
# Spawn a local daemon
|
||||||
os.spawnlp(os.P_NOWAIT, "deluged", "-p", port)
|
subprocess.Popen(["deluged", "-p %s" % port])
|
||||||
|
|
||||||
def on_button_close_clicked(self, widget):
|
def on_button_close_clicked(self, widget):
|
||||||
log.debug("on_button_close_clicked")
|
log.debug("on_button_close_clicked")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user