summaryrefslogtreecommitdiffstats
path: root/module/download_thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/download_thread.py')
-rw-r--r--module/download_thread.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/module/download_thread.py b/module/download_thread.py
index bb32030a7..a2318038a 100644
--- a/module/download_thread.py
+++ b/module/download_thread.py
@@ -32,7 +32,7 @@ class Status(object):
self.filename = None
self.url = None
self.exists = False
- self.waituntil = None
+ self.waituntil = 0
self.want_reconnect = False
def get_ETA(self):
@@ -43,7 +43,10 @@ class Status(object):
return self.pyfile.plugin.req.kB_left()
def size(self):
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()
+ return 0
class Download_Thread(threading.Thread):
def __init__(self, parent):
@@ -98,4 +101,4 @@ class Download_Thread(threading.Thread):
#startet downloader
#urllib.urlretrieve(status.url, pyfile.download_folder + "/" + status.filename, status)
- #self.shutdown = True \ No newline at end of file
+ #self.shutdown = True