summaryrefslogtreecommitdiff
path: root/src/mailman/app/docs/hooks.txt
diff options
context:
space:
mode:
authorBarry Warsaw2010-09-08 22:35:20 -0400
committerBarry Warsaw2010-09-08 22:35:20 -0400
commit1726b47b6b9bd44d6f2240372d278c4bd22eaa7b (patch)
tree31d963ad8ed913e12e53d6cee808e7d4a52c8e7d /src/mailman/app/docs/hooks.txt
parent9685fa2a1277cf6733940ac012e319dc0f34e8d7 (diff)
downloadmailman-1726b47b6b9bd44d6f2240372d278c4bd22eaa7b.tar.gz
mailman-1726b47b6b9bd44d6f2240372d278c4bd22eaa7b.tar.zst
mailman-1726b47b6b9bd44d6f2240372d278c4bd22eaa7b.zip
Many documentation fixes for better Sphinx output.
Diffstat (limited to 'src/mailman/app/docs/hooks.txt')
-rw-r--r--src/mailman/app/docs/hooks.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman/app/docs/hooks.txt b/src/mailman/app/docs/hooks.txt
index efd5530f5..7e214f13f 100644
--- a/src/mailman/app/docs/hooks.txt
+++ b/src/mailman/app/docs/hooks.txt
@@ -4,7 +4,8 @@ Hooks
Mailman defines two initialization hooks, one which is run early in the
initialization process and the other run late in the initialization process.
-Hooks name an importable callable so it must be accessible on sys.path.
+Hooks name an importable callable so it must be accessible on ``sys.path``.
+::
>>> import os, sys
>>> from mailman.config import config
@@ -46,6 +47,7 @@ We can set the pre-hook in the configuration file.
The hooks are run in the second and third steps of initialization. However,
we can't run those initialization steps in process, so call a command line
script that will produce no output to force the hooks to run.
+::
>>> import subprocess
>>> from mailman.testing.layers import ConfigLayer
@@ -71,6 +73,7 @@ Post-hook
=========
We can set the post-hook in the configuration file.
+::
>>> with open(config_path, 'w') as fp:
... print >> fp, """\
@@ -92,6 +95,7 @@ Running both hooks
==================
We can set the pre- and post-hooks in the configuration file.
+::
>>> with open(config_path, 'w') as fp:
... print >> fp, """\