diff options
author | spoob <spoob@gmx.de> | 2009-08-18 20:56:50 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-08-18 20:56:50 +0200 |
commit | 0e843b30e373d286df59fe768fb43a39e1416b61 (patch) | |
tree | eef42d764d30279822ae3b5cfa5388261d965c94 /module | |
parent | new webinterface functions (diff) | |
download | pyload-0e843b30e373d286df59fe768fb43a39e1416b61.tar.xz |
Updated Config System
Diffstat (limited to 'module')
-rw-r--r-- | module/Py_Load_File.py | 4 | ||||
-rw-r--r-- | module/file_list.py | 4 | ||||
-rw-r--r-- | module/thread_list.py | 14 |
3 files changed, 11 insertions, 11 deletions
diff --git a/module/Py_Load_File.py b/module/Py_Load_File.py index 570e605cd..278b8f6c7 100644 --- a/module/Py_Load_File.py +++ b/module/Py_Load_File.py @@ -30,8 +30,8 @@ class PyLoadFile: def init_download(self): - if self.parent.config['useproxy']: - self.plugin.req.add_proxy(self.parent.config['proxyprotocol'], self.parent.config['proxyadress']) + if self.parent.config['proxy']['activated']: + self.plugin.req.add_proxy(self.parent.config['proxy']['protocol'], self.parent.config['proxy']['adress']) #@todo: check dependicies, ocr etc diff --git a/module/file_list.py b/module/file_list.py index a83ab61a5..35bec757f 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -37,7 +37,7 @@ class File_List(object): def new_pyfile(self, url): url = url.replace("\n", "") pyfile = PyLoadFile(self.core, url) - pyfile.download_folder = self.core.config['download_folder'] + pyfile.download_folder = self.core.config['general']['download_folder'] pyfile.id = self.get_id() return pyfile @@ -56,7 +56,7 @@ class File_List(object): self.append(url) def remove(self, pyfile): - if not self.core.config['debug_mode']: + if not self.core.config['general']['debug_mode']: if pyfile in self.files: self.files.remove(pyfile) diff --git a/module/thread_list.py b/module/thread_list.py index 778e2587d..d4f2dac97 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -32,7 +32,7 @@ class Thread_List(object): self.parent = parent self.list = parent.file_list #file list self.threads = [] - self.max_threads = int(self.parent.config['max_downloads']) + self.max_threads = int(self.parent.config['general']['max_downloads']) self.lock = RLock() self.py_downloading = [] # files downloading self.occ_plugins = [] #occupied plugins @@ -113,7 +113,7 @@ class Thread_List(object): elif pyfile.status.type == "failed": self.parent.logger.warning("Download failed: " + pyfile.url+ " | " + pyfile.status.error) - with open(self.parent.config['failed_file'], 'a') as f: + with open(self.parent.config['general']['failed_file'], 'a') as f: f.write(pyfile.url + "\n") self.list.remove(pyfile) @@ -128,12 +128,12 @@ class Thread_List(object): def init_reconnect(self): """initialise a reonnect""" - if not self.parent.config['use_reconnect'] or self.reconnecting or not self.parent.is_reconnect_time(): + if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.is_reconnect_time(): return False - if not exists(self.parent.config['reconnect_method']): - self.parent.logger.info(self.parent.config['reconnect_method'] + " not found") - self.parent.config['use_reconnect'] = False + if not exists(self.parent.config['general']['reconnect_method']): + self.parent.logger.info(self.parent.config['general']['reconnect_method'] + " not found") + self.parent.config['general']['use_reconnect'] = False return False self.lock.acquire() @@ -167,7 +167,7 @@ class Thread_List(object): return False def reconnect(self): - reconn = subprocess.Popen(self.parent.config['reconnect_method']) + reconn = subprocess.Popen(self.parent.config['general']['reconnect_method']) reconn.wait() time.sleep(1) ip = "" |