summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to '')
-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.