diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/Plugin.py | 3 | ||||
-rw-r--r-- | module/download_thread.py | 7 | ||||
-rw-r--r-- | module/file_list.py | 1 | ||||
-rw-r--r-- | module/plugins/Hook.py | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/module/Plugin.py b/module/Plugin.py index 2e61a1b55..5006da8dd 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -19,12 +19,11 @@ import logging import re -from os.path import exists, join +from os.path import exists from time import sleep from module.network.Request import Request -from module.XMLConfigParser import XMLConfigParser from module.download_thread import CaptchaError diff --git a/module/download_thread.py b/module/download_thread.py index a07f4511f..4a031a04c 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -49,7 +49,8 @@ class Status(object): return self.pyfile.plugin.req.dl_size / 1024 def percent(self): if not self.kB_left() == 0 and not self.size() == 0: - return ((self.size()-self.kB_left()) * 100) / self.size() + percent = ((self.size()-self.kB_left()) * 100) / self.size() + return percent if percent < 101 else 0 return 0 class Reconnect(Exception): @@ -115,7 +116,9 @@ class Download_Thread(threading.Thread): self.loadedPyFile.status.error = str(e) finally: self.parent.job_finished(self.loadedPyFile) - sleep(0.5) + else: + sleep(3) + sleep(0.8) if self.shutdown: sleep(1) self.parent.remove_thread(self) diff --git a/module/file_list.py b/module/file_list.py index bbea40e23..2785afdb2 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -144,6 +144,7 @@ class File_List(object): return files def getAllFiles(self): + files = [] for pypack in self.data["queue"] + self.data["packages"]: for pyfile in pypack.files: diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 6f8a48802..541d0c2e9 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -19,9 +19,7 @@ """ import logging -from os.path import join -from module.XMLConfigParser import XMLConfigParser class Hook(): def __init__(self, core): |