summaryrefslogtreecommitdiffstats
path: root/module/HookManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-04 17:19:41 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-04 17:19:41 +0100
commitacd4dceb711e9148ede208bb67dc37bfaafd612b (patch)
tree8b36d3621da994285331b75061c5efefb4d60be1 /module/HookManager.py
parentoops (diff)
downloadpyload-acd4dceb711e9148ede208bb67dc37bfaafd612b.tar.xz
improved captcha manager
Diffstat (limited to 'module/HookManager.py')
-rw-r--r--module/HookManager.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/HookManager.py b/module/HookManager.py
index bc79b3c1c..6c6c0170f 100644
--- a/module/HookManager.py
+++ b/module/HookManager.py
@@ -20,6 +20,7 @@
import traceback
from threading import RLock
+from operator import methodcaller
from module.PluginThread import HookThread
from time import time
@@ -75,7 +76,7 @@ class HookManager():
def wrapPeriodical(plugin):
plugin.lastCall = time()
try:
- plugin.periodical()
+ if plugin.isActivated(): plugin.periodical()
except Exception, e:
self.core.log.error(_("Error executing hooks: %s") % str(e))
if self.core.debug:
@@ -143,3 +144,7 @@ class HookManager():
def startThread(self, function, pyfile):
t = HookThread(self.core.threadManager, function, pyfile)
+
+ def activePlugins(self):
+ """ returns all active plugins """
+ return filter(methodcaller("isActivated"), self.plugins)