diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-28 20:47:31 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-28 20:47:31 +0200 |
commit | 1b06d629938ccc676a0aa079c96017c32751748d (patch) | |
tree | a0291ecdb6bc31ecaaff233b950934a054a6a040 /module | |
parent | dump all loads in debug mode (diff) | |
download | pyload-1b06d629938ccc676a0aa079c96017c32751748d.tar.xz |
dont check for pil
Diffstat (limited to 'module')
-rw-r--r-- | module/PluginThread.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index 572561eb0..d4a0ed667 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -106,6 +106,12 @@ class PluginThread(Thread): f.write(dump) f.close() + def clean(self, pyfile): + """ set thread unactive and clean pyfile """ + pyfile.plugin.req.clean() + self.active = False + pyfile.release() + ######################################################################## class DownloadThread(PluginThread): @@ -166,18 +172,14 @@ class DownloadThread(PluginThread): self.m.log.error(_("Plugin %s is missing a function.") % pyfile.pluginname) pyfile.setStatus("failed") pyfile.error = "Plugin does not work" - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) continue except Abort: self.m.log.info(_("Download aborted: %s") % pyfile.name) pyfile.setStatus("aborted") - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) continue except Reconnect: @@ -207,9 +209,7 @@ class DownloadThread(PluginThread): self.m.log.warning(_("Download failed: %(name)s | %(msg)s") % {"name": pyfile.name, "msg": msg}) pyfile.error = msg - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) continue except error, e: @@ -228,9 +228,7 @@ class DownloadThread(PluginThread): self.m.log.info(_("Download aborted: %s") % pyfile.name) pyfile.setStatus("aborted") - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) else: pyfile.plugin.req.canContinue = False self.queue.put(pyfile) @@ -244,9 +242,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) continue except Exception, e: @@ -258,9 +254,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - pyfile.plugin.req.clean() - self.active = False - pyfile.release() + self.clean(pyfile) continue |