summaryrefslogtreecommitdiffstats
path: root/pyload/manager
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/manager')
-rw-r--r--pyload/manager/Account.py4
-rw-r--r--pyload/manager/Captcha.py2
-rw-r--r--pyload/manager/Remote.py4
-rw-r--r--pyload/manager/Thread.py18
-rw-r--r--pyload/manager/thread/Plugin.py6
-rw-r--r--pyload/manager/thread/Server.py14
6 files changed, 24 insertions, 24 deletions
diff --git a/pyload/manager/Account.py b/pyload/manager/Account.py
index ea6f15e87..4e4a82aed 100644
--- a/pyload/manager/Account.py
+++ b/pyload/manager/Account.py
@@ -23,11 +23,11 @@ class AccountManager(object):
self.lock = Lock()
self.initPlugins()
- self.saveAccounts() # save to add categories to conf
+ self.saveAccounts() #: save to add categories to conf
def initPlugins(self):
- self.accounts = {} # key = ( plugin )
+ self.accounts = {} #: key = ( plugin )
self.plugins = {}
self.initAccountPlugins()
diff --git a/pyload/manager/Captcha.py b/pyload/manager/Captcha.py
index 0814cf78a..4a7582d65 100644
--- a/pyload/manager/Captcha.py
+++ b/pyload/manager/Captcha.py
@@ -54,7 +54,7 @@ class CaptchaManager(object):
cli = self.core.isClientConnected()
if cli: #: client connected -> should solve the captcha
- task.setWaiting(timeout) #wait 50 sec for response
+ task.setWaiting(timeout) #: wait 50 sec for response
for plugin in self.core.addonManager.activePlugins():
try:
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 fb302ef0a..015bc9ab1 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/Plugin.py b/pyload/manager/thread/Plugin.py
index 658ce4550..08a2664da 100644
--- a/pyload/manager/thread/Plugin.py
+++ b/pyload/manager/thread/Plugin.py
@@ -28,7 +28,7 @@ class PluginThread(Thread):
"""Constructor"""
Thread.__init__(self)
self.setDaemon(True)
- self.m = manager #thread manager
+ self.m = manager #: thread manager
def writeDebugReport(self, pyfile):
@@ -52,7 +52,7 @@ class PluginThread(Thread):
pass
info = zipfile.ZipInfo(fs_join(pyfile.pluginname, "debug_Report.txt"), gmtime())
- info.external_attr = 0644 << 16L # change permissions
+ info.external_attr = 0644 << 16L #: change permissions
zip.writestr(info, dump)
zip.close()
@@ -95,7 +95,7 @@ class PluginThread(Thread):
del frame
- del stack #delete it just to be sure...
+ del stack #: delete it just to be sure...
dump += "\n\nPLUGIN OBJECT DUMP: \n\n"
diff --git a/pyload/manager/thread/Server.py b/pyload/manager/thread/Server.py
index b724ad2f9..990325f5d 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)
@@ -103,7 +103,7 @@ class WebServer(threading.Thread):
try:
webinterface.run_fcgi(host=self.host, port=self.port)
- except ValueError: #@TODO: Fix https://github.com/pyload/pyload/issues/1145
+ except ValueError: #@TODO: Fix https://github.com/pyload/pyload/issues/1145
pass