From fb145cf68c0178b9551eaae3213ec01be112bf76 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 24 Sep 2012 15:41:13 +0200 Subject: fixed some things, so downloads works again --- module/threads/DownloadThread.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'module/threads/DownloadThread.py') diff --git a/module/threads/DownloadThread.py b/module/threads/DownloadThread.py index 0269b0660..cf59c5639 100644 --- a/module/threads/DownloadThread.py +++ b/module/threads/DownloadThread.py @@ -38,7 +38,7 @@ class DownloadThread(BaseThread): BaseThread.__init__(self, manager) self.queue = Queue() # job queue - self.active = False + self.active = None self.start() @@ -52,7 +52,7 @@ class DownloadThread(BaseThread): pyfile = self.active if self.active == "quit": - self.active = False + self.active = None self.m.threads.remove(self) return True @@ -212,11 +212,19 @@ class DownloadThread(BaseThread): pyfile.finishIfDone() self.core.files.save() + def getProgress(self): + if self.active: + return self.active.getProgressInfo() + def put(self, job): """assign a job to the thread""" self.queue.put(job) + def clean(self, pyfile): + """ set thread inactive and release pyfile """ + self.active = False + pyfile.release() def stop(self): """stops the thread""" -- cgit v1.2.3