diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-07-30 21:35:29 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-07-30 21:35:29 +0200 |
commit | 2497c100de34c113304227f72015bfb3755854a3 (patch) | |
tree | e382f92368a37d623f5aea5d02609a13a1c338d8 /module/HookManager.py | |
parent | restart working and client information (diff) | |
download | pyload-2497c100de34c113304227f72015bfb3755854a3.tar.xz |
daily commit
Diffstat (limited to 'module/HookManager.py')
-rw-r--r-- | module/HookManager.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index 96815ef63..9579c74a1 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -20,7 +20,7 @@ import traceback from threading import RLock - +from module.PluginThread import HookThread class HookManager(): def __init__(self, core): @@ -76,13 +76,19 @@ class HookManager(): def downloadFinished(self, pyfile): for plugin in self.plugins: - plugin.downloadFinished(pyfile) + if "downloadFinished" in plugin.__threaded__: + self.startThread(plugin.downloadFinished, pyfile) + else: + plugin.downloadFinished(pyfile) @lock def packageFinished(self, package): for plugin in self.plugins: - plugin.packageFinished(package) + if "packageFinished" in plugin.__threaded__: + self.startThread(plugin.packageFinished, pyfile) + else: + plugin.packageFinished(package) @lock def beforeReconnecting(self, ip): @@ -95,3 +101,6 @@ class HookManager(): for plugin in self.plugins: plugin.afterReconnecting(ip) + + def startThread(self, function, pyfile): + t = HookThread(self.core.threadManager, function, pyfile) |