summaryrefslogtreecommitdiff
path: root/src/mailman/plugins/testing/example/hooks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/plugins/testing/example/hooks.py')
-rw-r--r--src/mailman/plugins/testing/example/hooks.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mailman/plugins/testing/example/hooks.py b/src/mailman/plugins/testing/example/hooks.py
new file mode 100644
index 000000000..55c09c4a5
--- /dev/null
+++ b/src/mailman/plugins/testing/example/hooks.py
@@ -0,0 +1,21 @@
+import os
+
+from mailman.interfaces.plugin import IPlugin
+from public import public
+from zope.interface import implementer
+
+
+@public
+@implementer(IPlugin)
+class ExamplePlugin:
+ def pre_hook(self):
+ if os.environ.get('DEBUG_HOOKS'):
+ print("I'm in my pre-hook")
+
+ def post_hook(self):
+ if os.environ.get('DEBUG_HOOKS'):
+ print("I'm in my post-hook")
+
+ @property
+ def resource(self):
+ return None