From 0336919f4ce067333462a2c6e196daf6a4062a6a Mon Sep 17 00:00:00 2001 From: spoob Date: Wed, 12 Aug 2009 20:08:03 +0200 Subject: added debug mode --- config | 3 ++- module/file_list.py | 12 +++++------- pyLoadCore.py | 6 ++++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config b/config index ef8708f58..7ec9ab547 100644 --- a/config +++ b/config @@ -15,6 +15,7 @@ use_reconnect = False link_file = links.txt failed_file = failed_links.txt reconnect_method = reconnect_method +debug_mode = False [updates] search_updates = True @@ -31,4 +32,4 @@ end = 0:00 [proxy] useproxy = False proxyadress = http://localhost:8080 -proxyprotocol = http \ No newline at end of file +proxyprotocol = http diff --git a/module/file_list.py b/module/file_list.py index d3af2c1b2..8c1c32564 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -56,14 +56,12 @@ class File_List(object): self.append(url) def remove(self, pyfile): + if not self.config['debug_mode']: + if pyfile in self.files: + self.files.remove(pyfile) - pass - # - #if pyfile in self.files: - #self.files.remove(pyfile) -# - #self.data['order'].remove(pyfile.id) - #del self.data[pyfile.id] + self.data['order'].remove(pyfile.id) + del self.data[pyfile.id] def remove_id(self, pyid): #also abort download diff --git a/pyLoadCore.py b/pyLoadCore.py index c7c5140c2..8805905de 100644 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -62,8 +62,10 @@ class Core(object): self.check_create(self.config['link_file'], _("file for links"), False) self.check_create(self.config['failed_file'], _("file for failed links"), False) - self.init_logger(logging.DEBUG) # logging level - + if self.config['debug_mode']: + self.init_logger(logging.DEBUG) # logging level + else: + self.init_logger(logging.INFO) # logging level self.check_update() -- cgit v1.2.3