diff options
Diffstat (limited to 'module/download_thread.py')
-rw-r--r-- | module/download_thread.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index 5313a7d34..3ad2ba85d 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- -# +# -*- coding: utf-8 -*- +# #Copyright (C) 2009 sp00b, sebnapi # #This program is free software; you can redistribute it and/or modify @@ -34,15 +34,15 @@ class Status(object): self.exists = False self.waituntil = None self.want_reconnect = False - + def get_ETA(self): return self.pyfile.plugin.req.get_ETA() def get_speed(self): return self.pyfile.plugin.req.get_speed() def kB_left(self): return self.pyfile.plugins.req.kB_left() - - + + class Download_Thread(threading.Thread): def __init__(self, parent): threading.Thread.__init__(self) @@ -50,9 +50,9 @@ class Download_Thread(threading.Thread): self.parent = parent self.setDaemon(True) self.loadedPyFile = None - + self.start() - + def run(self): while (not self.shutdown): if self.parent.py_load_files: @@ -76,24 +76,24 @@ class Download_Thread(threading.Thread): if not status.exists: raise "FileDontExists" #i know its deprecated, who cares^^ - - status.type = "waiting" + + status.type = "waiting" while (time() < status.waituntil): if self.parent.init_reconnect() or self.parent.reconnecting: status.type = "reconnected" - status.want_reconnect = False + status.want_reconnect = False return False sleep(1) status.want_reconnect = False - + status.type = "downloading" - + pyfile.plugin.proceed(status.url, pyfile.download_folder + "/" + status.filename) status.type = "finished" #startet downloader - #urllib.urlretrieve(status.url, pyfile.download_folder + "/" + status.filename, status) - #self.shutdown = True + #urllib.urlretrieve(status.url, pyfile.download_folder + "/" + status.filename, status) + #self.shutdown = True
\ No newline at end of file |