From 9ff7fe5187f9b481847019ac3a30fe29ba4359ff Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 1 Jun 2009 19:55:47 +0200 Subject: reconnect, not working, dont try it out --- module/download_thread.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'module/download_thread.py') diff --git a/module/download_thread.py b/module/download_thread.py index f8786c810..cced6508a 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -34,9 +34,9 @@ class Status(object): self.expected_time = 0 self.filename = None self.url = None - self.exists = None + self.exists = False self.waituntil = None - self.want_reconnect = None + self.want_reconnect = False # def __call__(self, blocks_read, block_size, total_size): # if self.status_queue == None: @@ -99,15 +99,19 @@ class Download_Thread(threading.Thread): raise "FileDontExists" #i know its deprecated, who cares^^ if status.want_reconnect: - print "handle reconnect" + reconnect = self.parent.init_reconnect(pyfile) + if reconnect: + status.type = "reconnected" + return False while (time() < status.waituntil): - if status.want_reconnect and self.reconnected: - status = "reconnected" + if status.want_reconnect and self.parent.reconnecting: + status.type = "reconnected" return False status.type = "waiting" - sleep(1) #eventuell auf genaue zeit warten - + sleep(1) + + status.want_reconnect = False try: status.type = "downloading" -- cgit v1.2.3