From 48588a0d05492e46126776c3e7023397b9ad0b90 Mon Sep 17 00:00:00 2001 From: spoob Date: Sun, 27 Dec 2009 02:40:56 +0100 Subject: Fixed reconnect loop (easy doing) --- module/download_thread.py | 3 +-- module/thread_list.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index be6ff6bf0..3d4aa065d 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -77,7 +77,7 @@ class Download_Thread(threading.Thread): self.start() def run(self): - while (not self.shutdown): + while not self.shutdown: self.loadedPyFile = self.parent.get_job() if self.loadedPyFile: try: @@ -165,4 +165,3 @@ class Download_Thread(threading.Thread): sleep(1) pyfile.status.want_reconnect = False return True - diff --git a/module/thread_list.py b/module/thread_list.py index 719849585..ad0d0c8fb 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -188,17 +188,18 @@ class Thread_List(object): return False def reconnect(self): + self.parent.logger.info("Start reconnect") reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" - while ip == "": #solange versuch bis neue ip ausgelesen + while ip == "": try: ip = re.match(".*Current IP Address: (.*).*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) #versuchen neue ip aus zu lesen except: ip = "" time.sleep(1) - scripts_reconnected(ip) + self.scripts_reconnected(ip) self.parent.logger.info("Reconnected, new IP: " + ip) @@ -300,4 +301,3 @@ class Thread_List(object): continue speed[2].plugin.req.maxSpeed = eachSpeed*1024 print "max", speed[2].plugin.req.maxSpeed, "current", speed[2].plugin.req.dl_speed - -- cgit v1.2.3