diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-03-07 15:18:18 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-03-07 15:18:18 +0000 |
commit | 7e28ca3be562830401c1562f4c5d9b3bea661497 (patch) | |
tree | a32644b01f18bbe927f000a1f0db1ed73082f88c | |
parent | 8a8634397b25d64f22b7699f74365d45cbc1ab20 (diff) | |
download | pykolab-7e28ca3be562830401c1562f4c5d9b3bea661497.tar.gz |
Hooks in plugins may also like keyword dictionaries as arguments
-rw-r--r-- | pykolab/plugins.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pykolab/plugins.py b/pykolab/plugins.py index 0c0c272..095c50c 100644 --- a/pykolab/plugins.py +++ b/pykolab/plugins.py @@ -179,7 +179,7 @@ class KolabPlugins: return False - def exec_hook(self, hook, plugins=[], args=()): + def exec_hook(self, hook, plugins=[], kw={}, args=()): """Execute a hook""" if len(plugins) < 1: @@ -195,7 +195,7 @@ class KolabPlugins: if hasattr(getattr(self,plugin),hook): try: - exec("retval = self.%s.%s(args=%r)" % (plugin,hook,args)) + exec("retval = self.%s.%s(kw=%r, args=%r)" % (plugin,hook,kw,args)) except TypeError, e: print >> sys.stderr, _("Cannot execute hook %s for plugin %s: %s") % (hook,plugin,e) except AttributeError, e: |