diff options
author | necoro <> | 2007-04-25 16:05:46 +0000 |
---|---|---|
committer | necoro <> | 2007-04-25 16:05:46 +0000 |
commit | 28c524e8243f9eb41f2ecb7197e33711727526d9 (patch) | |
tree | 1ac2ddf2cd27411c0e9d634283873a9642ccb131 /portato/plugin.py | |
parent | 86490cd2c9f7523835ecedf472398845c56b5c0c (diff) | |
download | portato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.gz portato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.bz2 portato-28c524e8243f9eb41f2ecb7197e33711727526d9.zip |
added noroot-option
Diffstat (limited to '')
-rw-r--r-- | portato/plugin.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/portato/plugin.py b/portato/plugin.py index 4c5070e..3d67f5b 100644 --- a/portato/plugin.py +++ b/portato/plugin.py @@ -299,7 +299,7 @@ class PluginQueue: except AttributeError: debug(cmd.hook.call,"cannot be imported", error = 1) - f(*hargs, **hkwargs) # call function + return f(*hargs, **hkwargs) # call function def hook_decorator (func): """This is the real decorator.""" @@ -310,6 +310,8 @@ class PluginQueue: def wrapper (*args, **kwargs): + ret = None + # before for cmd in list[0]: debug("Accessing hook '%s' of plugin '%s' (before)" % (hook, cmd.hook.plugin.name)) @@ -317,15 +319,17 @@ class PluginQueue: if list[1]: # override debug("Overriding hook '%s' with plugin '%s'" % (hook, list[1][0].hook.plugin.name)) - call(list[1][0]) + ret = call(list[1][0]) else: # normal - func(*args, **kwargs) + ret = func(*args, **kwargs) # after for cmd in list[2]: debug("Accessing hook '%s' of plugin '%s' (after)" % (hook, cmd.hook.plugin.name)) call(cmd) + return ret + return wrapper return hook_decorator |