summaryrefslogtreecommitdiffstats
path: root/module/HookManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-11 21:04:48 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-11 21:04:48 +0200
commitecadad99f03e33d4672e9ac2d5d1dca0d541b983 (patch)
tree65ac2f5a94cc50d8ef8044b6cb1616937105d2b9 /module/HookManager.py
parentfixes (diff)
downloadpyload-ecadad99f03e33d4672e9ac2d5d1dca0d541b983.tar.xz
jeixs irc interface, cleaned some code
Diffstat (limited to 'module/HookManager.py')
-rw-r--r--module/HookManager.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/HookManager.py b/module/HookManager.py
index 7cd903403..41e4c5ef0 100644
--- a/module/HookManager.py
+++ b/module/HookManager.py
@@ -41,6 +41,14 @@ class HookManager():
args[0].lock.release()
return res
return new
+
+ def try_catch(func):
+ def new(*args):
+ try:
+ return func(*args)
+ except Exception, e:
+ args[0].log.error(_("Error executing hooks: %s") % str(e))
+ return new
def createIndex(self):
@@ -50,6 +58,7 @@ class HookManager():
#hookClass = getattr(plugin, plugin.__name__)
if self.core.config.getPlugin(pluginClass.__name__, "load"):
+ #@TODO handle in pluginmanager
plugin = pluginClass(self.core)
plugins.append(plugin)
self.log.info(_("%s loaded, activated %s") % (pluginClass.__name__, plugin.isActivated() ))
@@ -67,6 +76,8 @@ class HookManager():
plugin.periodical()
plugin.lastCall = time()
+
+ @try_catch
def coreReady(self):
for plugin in self.plugins:
if plugin.isActivated():