summaryrefslogtreecommitdiffstats
path: root/pyload/manager
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/manager')
-rw-r--r--pyload/manager/Remote.py4
-rw-r--r--pyload/manager/Thread.py18
-rw-r--r--pyload/manager/thread/Server.py12
3 files changed, 17 insertions, 17 deletions
diff --git a/pyload/manager/Remote.py b/pyload/manager/Remote.py
index 4fdb36fc2..a27667070 100644
--- a/pyload/manager/Remote.py
+++ b/pyload/manager/Remote.py
@@ -62,8 +62,8 @@ class RemoteManager(object):
def startBackends(self):
- host = self.core.config["remote"]["listenaddr"]
- port = self.core.config["remote"]["port"]
+ host = self.core.config.get("remote", "listenaddr")
+ port = self.core.config.get("remote", "port")
for b in self.available:
klass = getattr(__import__("pyload.remote.%s" % b, globals(), locals(), [b], -1), b)
diff --git a/pyload/manager/Thread.py b/pyload/manager/Thread.py
index dd1582eb7..1f1a2dc5c 100644
--- a/pyload/manager/Thread.py
+++ b/pyload/manager/Thread.py
@@ -150,7 +150,7 @@ class ThreadManager(object):
def tryReconnect(self):
"""checks if reconnect needed"""
- if not (self.core.config["reconnect"]["activated"] and self.core.api.isTimeReconnect()):
+ if not (self.core.config.get("reconnect", "activated") and self.core.api.isTimeReconnect()):
return False
active = [x.active.plugin.wantReconnect and x.active.plugin.waiting for x in self.threads if x.active]
@@ -158,11 +158,11 @@ class ThreadManager(object):
if not (0 < active.count(True) == len(active)):
return False
- if not exists(self.core.config['reconnect']['method']):
- if exists(join(pypath, self.core.config['reconnect']['method'])):
- self.core.config['reconnect']['method'] = join(pypath, self.core.config['reconnect']['method'])
+ if not exists(self.core.config.get("reconnect", "method")):
+ if exists(join(pypath, self.core.config.get("reconnect", "method"))):
+ self.core.config['reconnect']['method'] = join(pypath, self.core.config.get("reconnect", "method"))
else:
- self.core.config["reconnect"]["activated"] = False
+ self.core.config['reconnect']['activated'] = False
self.core.log.warning(_("Reconnect script not found!"))
return
@@ -181,10 +181,10 @@ class ThreadManager(object):
self.core.log.debug("Old IP: %s" % ip)
try:
- reconn = Popen(self.core.config['reconnect']['method'], bufsize=-1, shell=True) # , stdout=subprocess.PIPE)
+ reconn = Popen(self.core.config.get("reconnect", "method"), bufsize=-1, shell=True) # , stdout=subprocess.PIPE)
except Exception:
self.core.log.warning(_("Failed executing reconnect script!"))
- self.core.config["reconnect"]["activated"] = False
+ self.core.config['reconnect']['activated'] = False
self.reconnecting.clear()
if self.core.debug:
print_exc()
@@ -278,8 +278,8 @@ class ThreadManager(object):
return
if job.plugin.getPluginType() == "hoster":
- spaceLeft = freeSpace(self.core.config["general"]["download_folder"]) / 1024 / 1024
- if spaceLeft < self.core.config["general"]["min_free_space"]:
+ spaceLeft = freeSpace(self.core.config.get("general", "download_folder")) / 1024 / 1024
+ if spaceLeft < self.core.config.get("general", "min_free_space"):
self.core.log.warning(_("Not enough space left on device"))
self.pause = True
diff --git a/pyload/manager/thread/Server.py b/pyload/manager/thread/Server.py
index b724ad2f9..48958f6fb 100644
--- a/pyload/manager/thread/Server.py
+++ b/pyload/manager/thread/Server.py
@@ -20,12 +20,12 @@ class WebServer(threading.Thread):
self.core = pycore
core = pycore
self.running = True
- self.server = pycore.config['webui']['server']
- self.https = pycore.config['webui']['https']
- self.cert = pycore.config["ssl"]["cert"]
- self.key = pycore.config["ssl"]["key"]
- self.host = pycore.config['webui']['host']
- self.port = pycore.config['webui']['port']
+ self.server = pycore.config.get("webui", "server")
+ self.https = pycore.config.get("webui", "https")
+ self.cert = pycore.config.get("ssl", "cert")
+ self.key = pycore.config.get("ssl", "key")
+ self.host = pycore.config.get("webui", "host")
+ self.port = pycore.config.get("webui", "port")
self.setDaemon(True)