summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-27 16:24:03 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-27 16:24:03 +0200
commit5f8a4d25ea9034cadc8ae19a2ffab788f62cc56c (patch)
tree9d947797aafb3e9d97dbf10313c5f48f6f3d6198 /module/plugins
parentMerge (diff)
downloadpyload-5f8a4d25ea9034cadc8ae19a2ffab788f62cc56c.tar.xz
reworked authorization, now works on api level
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Hook.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index 7e4f58c66..85fb49190 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -23,16 +23,10 @@ from traceback import print_exc
class Expose(object):
""" used for decoration to declare rpc services """
- def __init__(self, *args, **kwargs):
- self._f = args[0]
- hookManager.addRPC(self._f.__module__, self._f.func_name, self._f.func_doc)
- def __get__(self, obj, klass):
- self._obj = obj
- return self
-
- def __call__(self, *args, **kwargs):
- return self._f(self._obj, *args, **kwargs)
+ def __new__(cls, f, *args, **kwargs):
+ hookManager.addRPC(f.__module__, f.func_name, f.func_doc)
+ return f
def threaded(f):
def run(*args,**kwargs):