summaryrefslogtreecommitdiff
path: root/portato/plugin.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-07-05 02:37:03 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-07-05 02:37:03 +0200
commitcd5751b7a49f12ae9baf33f7c692dc9da85d355e (patch)
tree8569e9506937ff1e51a1b16fbef7200b4e0f7bf8 /portato/plugin.py
parentcc912fd1e75d211c1b2636318d3c99f4b213709f (diff)
downloadportato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.tar.gz
portato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.tar.bz2
portato-cd5751b7a49f12ae9baf33f7c692dc9da85d355e.zip
Add dummy_hook()
Diffstat (limited to 'portato/plugin.py')
-rw-r--r--portato/plugin.py12
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.