summaryrefslogtreecommitdiffstats
path: root/module/plugins/Hook.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-05 20:13:16 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-05 20:13:16 +0200
commit2dcf398b41b198823f058182b4460f83ca217aee (patch)
treecf3cd416f612757bc7b953e77999423b37744f86 /module/plugins/Hook.py
parentapi account fix (diff)
downloadpyload-2dcf398b41b198823f058182b4460f83ca217aee.tar.xz
fixes, closed #361
Diffstat (limited to 'module/plugins/Hook.py')
-rw-r--r--module/plugins/Hook.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index 47faba95a..3db3e47e9 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -55,6 +55,11 @@ class Hook():
#: automatically register event listeners for functions, attribute will be deleted dont use it yourself
event_map = None
+ # Alternative to event_map
+ #: List of events the plugin can handle, name the functions exactly like eventname.
+ event_list = None # dont make duplicate entries in event_map
+
+
#: periodic call interval in secondc
interval = 60
@@ -78,8 +83,14 @@ class Hook():
else:
self.manager.addEvent(event, getattr(self,funcs))
- #delete for various reasons
- self.event_map = None
+ #delete for various reasons
+ self.event_map = None
+
+ if self.event_list:
+ for f in self.event_list:
+ self.manager.addEvent(f, getattr(self,f))
+
+ self.event_list = None
self.setup()
@@ -140,9 +151,6 @@ class Hook():
def periodical(self):
pass
- def unrarFinished(self, folder, fname):
- pass
-
def newCaptchaTask(self, task):
""" new captcha task for the plugin, it MUST set the handler and timeout or will be ignored """
pass