Fix #338 do not continue in classic mode if 'deluged' is not available
This commit is contained in:
parent
e27d8bacd4
commit
152c45b6ef
|
@ -147,6 +147,24 @@ class GtkUI:
|
||||||
# Make sure gtkui.conf has at least the defaults set
|
# Make sure gtkui.conf has at least the defaults set
|
||||||
self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS)
|
self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS)
|
||||||
|
|
||||||
|
# We need to check for the existence of 'deluged' in the system path
|
||||||
|
# before allowing to continue in classic mode.
|
||||||
|
if self.config["classic_mode"]:
|
||||||
|
try:
|
||||||
|
if deluge.common.windows_check():
|
||||||
|
import win32api
|
||||||
|
win32api.WinExec("deluged --version")
|
||||||
|
else:
|
||||||
|
import subprocess
|
||||||
|
retcode = subprocess.call("deluged" + " --version", shell=True)
|
||||||
|
log.debug("retcode: %s", retcode)
|
||||||
|
if retcode == 127:
|
||||||
|
log.error("Unable to find deluged!")
|
||||||
|
self.config["classic_mode"] = False
|
||||||
|
except Exception, e:
|
||||||
|
log.error("Unable to find deluged: %s", e)
|
||||||
|
self.config["classic_mode"] = False
|
||||||
|
|
||||||
# We need to check on exit if it was started in classic mode to ensure we
|
# We need to check on exit if it was started in classic mode to ensure we
|
||||||
# shutdown the daemon.
|
# shutdown the daemon.
|
||||||
self.started_in_classic = self.config["classic_mode"]
|
self.started_in_classic = self.config["classic_mode"]
|
||||||
|
|
Loading…
Reference in New Issue