From 872412242c1a6e7217649d9606e9207893513434 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 22 May 2009 16:38:05 +0200 Subject: fixed little bugs --- module/download_thread.py | 28 +++++++++++++--------------- module/thread_list.py | 4 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index e8dbf64c0..7b6b0fe6d 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -94,26 +94,24 @@ class Download_Thread(threading.Thread): status = pyfile.status pyfile.prepareDownload() - if not status.exists: - return False + if status.exists: - if status.want_reconnect: - print "handle reconnect" - return False + if status.want_reconnect: + print "handle reconnect" - while (time() < status.waituntil): - status.type = "waiting" - sleep(1) #eventuell auf genaue zeit warten + while (time() < status.waituntil): + status.type = "waiting" + sleep(1) #eventuell auf genaue zeit warten - status.type = "downloading" - print status.url , status.filename + status.type = "downloading" + print status.url , status.filename - try: - pyfile.plugin.req.download(status.url, pyfile.download_folder + "/" + status.filename) - status.type = "finished" - except: - status.type = "failed" + try: + pyfile.plugin.req.download(status.url, pyfile.download_folder + "/" + status.filename) + status.type = "finished" + except: + status.type = "failed" self.parent.job_finished(pyfile) diff --git a/module/thread_list.py b/module/thread_list.py index 5f1710368..34fa05599 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -65,7 +65,7 @@ class Thread_List(object): pyfile = None - for i in range(0,len(self.py_load_files)): + for i in range(len(self.py_load_files)): if not self.py_load_files[i].modul.__name__ in self.occ_plugins: pyfile = self.py_load_files.pop(i) @@ -76,7 +76,7 @@ class Thread_List(object): self.lock.release() return pyfile - def job_finish(self, pyfile): + def job_finished(self, pyfile): self.lock.acquire() self.occ_plugins.remove(pyfile.modul.__name__) -- cgit v1.2.3