From e9dc8ea08452c1555e28f4ac1970b96315ec4376 Mon Sep 17 00:00:00 2001 From: spoob Date: Sun, 3 Jan 2010 21:12:02 +0100 Subject: Cleaned Reconnect XML Config --- module/config/core_default.xml | 10 +++++----- module/plugins/__init__.py | 1 + module/plugins/hoster/NetloadIn.py | 3 --- module/thread_list.py | 10 +++++----- pyLoadCore.py | 6 ++---- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 4c95d5386..035b676f0 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -31,10 +31,8 @@ de Downloads 3 - False links.txt failed_links.txt - None False 5 0 @@ -44,9 +42,11 @@ True False - - 0:00 - 0:00 + + False + None + 0:00 + 0:00 0:00 diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py index e69de29bb..8b1378917 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -0,0 +1 @@ + diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 1f7e7d011..0e5245e9e 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -40,7 +40,6 @@ class NetloadIn(Plugin): self.req.clear_cookies() self.want_reconnect = False - self.download_api_data() if self.file_exists(): pyfile.status.filename = self.get_file_name() @@ -49,7 +48,6 @@ class NetloadIn(Plugin): self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url - #@TODO: premium?? return True self.download_html() @@ -73,7 +71,6 @@ class NetloadIn(Plugin): src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} if not src == "unknown file_data": - print "apidata:", src lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] diff --git a/module/thread_list.py b/module/thread_list.py index d3eb4d203..5d0bcf53a 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -160,12 +160,12 @@ class Thread_List(object): def init_reconnect(self): """initialise a reonnect""" - if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): + if not self.parent.config['reconnect']['activated'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return 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 + if not exists(self.parent.config['reconnect']['method']): + self.parent.logger.info(self.parent.config['reconnect']['method'] + " not found") + self.parent.config['reconnect']['activated'] = False return False self.lock.acquire() @@ -200,7 +200,7 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" diff --git a/pyLoadCore.py b/pyLoadCore.py index 6eafee4ac..e586ee080 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -201,7 +201,6 @@ class Core(object): if self.config['webinterface']['activated']: self.webserver = WebServer(self) self.webserver.start() - def init_logger(self, level): console = logging.StreamHandler(stdout) @@ -217,7 +216,6 @@ class Core(object): self.logger.addHandler(console) #if console logging self.logger.setLevel(level) - def init_scripts(self): """ scan directory for scripts to execute""" f = lambda x: False if x.startswith("#") or x.endswith("~") else True @@ -604,8 +602,8 @@ class ServerMethods(): return self.core.compare_time(start, end) def is_time_reconnect(self): - start = self.core.config['reconnectTime']['start'].split(":") - end = self.core.config['reconnectTime']['end'].split(":") + start = self.core.config['reconnect']['startTime'].split(":") + end = self.core.config['reconnect']['endTime'].split(":") return self.core.compare_time(start, end) if __name__ == "__main__": -- cgit v1.2.3