diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-21 22:13:21 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-21 22:13:21 +0100 |
commit | 4eb1404eca2b795d809ee626a057a543043060cb (patch) | |
tree | db25eddebc985a6066001e38e593c8f45e468910 /module/download_thread.py | |
parent | Fixed Netload Wait (diff) | |
download | pyload-4eb1404eca2b795d809ee626a057a543043060cb.tar.xz |
some optimizations
Diffstat (limited to 'module/download_thread.py')
-rw-r--r-- | module/download_thread.py | 7 |
1 files changed, 5 insertions, 2 deletions
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) |