summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-05-17 20:06:11 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-05-17 20:06:11 +0200
commit2a74f88fcaf3d3baac24397de81a967c0b8c73e2 (patch)
treec80495e505432637cf69053967ea87090d69baa5 /module/plugins
parentsome multiuser db changes (diff)
downloadpyload-2a74f88fcaf3d3baac24397de81a967c0b8c73e2.tar.xz
small typo fixes and TODOs
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Addon.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/module/plugins/Addon.py b/module/plugins/Addon.py
index 3fc4eb467..614c68c80 100644
--- a/module/plugins/Addon.py
+++ b/module/plugins/Addon.py
@@ -20,7 +20,7 @@
from traceback import print_exc
#from functools import wraps
-from module.utils import has_method
+from module.utils import has_method, to_list
from Base import Base
@@ -34,10 +34,14 @@ class Expose(object):
return f
def AddEventListener(event):
- """ Used to register method for events. Arguments needs to match parameter of event """
+ """ Used to register method for events. Arguments needs to match parameter of event
+
+ :param event: Name of event or list of them.
+ """
class _klass(object):
def __new__(cls, f, *args, **kwargs):
- addonManager.addEventListener(class_name(f.__module__), f.func_name, event)
+ for ev in to_list(event):
+ addonManager.addEventListener(class_name(f.__module__), f.func_name, ev)
return f
return _klass
@@ -74,6 +78,8 @@ def AddonInfo(desc):
pass
def threaded(f):
+ """ Decorator to run method in a thread. """
+
#@wraps(f)
def run(*args,**kwargs):
addonManager.startThread(f, *args, **kwargs)