summaryrefslogtreecommitdiffstats
path: root/module/plugins/Hook.py
diff options
context:
space:
mode:
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