diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2009-07-05 02:37:03 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2009-07-05 02:37:03 +0200 |
commit | cd5751b7a49f12ae9baf33f7c692dc9da85d355e (patch) | |
tree | 8569e9506937ff1e51a1b16fbef7200b4e0f7bf8 /portato/plugin.py | |
parent | cc912fd1e75d211c1b2636318d3c99f4b213709f (diff) | |
download | portato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.tar.gz portato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.tar.bz2 portato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.zip |
Add dummy_hook()
Diffstat (limited to '')
-rw-r--r-- | portato/plugin.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/portato/plugin.py b/portato/plugin.py index 4914f25..c823ac7 100644 --- a/portato/plugin.py +++ b/portato/plugin.py @@ -635,6 +635,18 @@ def hook(hook, *args, **kwargs): else: return __plugins.hook(hook, *args, **kwargs) +def dummy_hook (h, *args, **kwargs): + """ + Creates a dummy hook, i.e. a hook which is only needed to trigger something in the plugins, but does nothing for itself. + """ + + if __plugins is None: + pass + else: + def dummy (): + pass + hook(h, *args, **kwargs)(dummy)() + def register (plugin, disable = False): """ Registers a plugin. |