summaryrefslogtreecommitdiffstats
path: root/module/download_thread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-01-21 22:13:21 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-01-21 22:13:21 +0100
commit4eb1404eca2b795d809ee626a057a543043060cb (patch)
treedb25eddebc985a6066001e38e593c8f45e468910 /module/download_thread.py
parentFixed Netload Wait (diff)
downloadpyload-4eb1404eca2b795d809ee626a057a543043060cb.tar.xz
some optimizations
Diffstat (limited to 'module/download_thread.py')
-rw-r--r--module/download_thread.py7
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)