summaryrefslogtreecommitdiff
path: root/mailman/pipeline/docs
diff options
context:
space:
mode:
Diffstat (limited to 'mailman/pipeline/docs')
-rw-r--r--mailman/pipeline/docs/acknowledge.txt3
-rw-r--r--mailman/pipeline/docs/archives.txt3
-rw-r--r--mailman/pipeline/docs/digests.txt16
-rw-r--r--mailman/pipeline/docs/nntp.txt3
-rw-r--r--mailman/pipeline/docs/replybot.txt3
-rw-r--r--mailman/pipeline/docs/tagger.txt1
-rw-r--r--mailman/pipeline/docs/to-outgoing.txt3
7 files changed, 15 insertions, 17 deletions
diff --git a/mailman/pipeline/docs/acknowledge.txt b/mailman/pipeline/docs/acknowledge.txt
index ccbb70e79..d1206b6f3 100644
--- a/mailman/pipeline/docs/acknowledge.txt
+++ b/mailman/pipeline/docs/acknowledge.txt
@@ -15,8 +15,7 @@ acknowledgment.
>>> # Ensure that the virgin queue is empty, since we'll be checking this
>>> # for new auto-response messages.
- >>> from mailman.queue import Switchboard
- >>> virginq = Switchboard(config.VIRGINQUEUE_DIR)
+ >>> virginq = config.switchboards['virgin']
>>> virginq.files
[]
diff --git a/mailman/pipeline/docs/archives.txt b/mailman/pipeline/docs/archives.txt
index 9595a36e0..d81f6e27b 100644
--- a/mailman/pipeline/docs/archives.txt
+++ b/mailman/pipeline/docs/archives.txt
@@ -8,10 +8,9 @@ archivers to work in a separate process from the main Mailman delivery
processes.
>>> from mailman.app.lifecycle import create_list
- >>> from mailman.queue import Switchboard
>>> handler = config.handlers['to-archive']
>>> mlist = create_list(u'_xtest@example.com')
- >>> switchboard = Switchboard(config.ARCHQUEUE_DIR)
+ >>> switchboard = config.switchboards['archive']
A helper function.
diff --git a/mailman/pipeline/docs/digests.txt b/mailman/pipeline/docs/digests.txt
index f478c1ec0..1d7112fd5 100644
--- a/mailman/pipeline/docs/digests.txt
+++ b/mailman/pipeline/docs/digests.txt
@@ -7,14 +7,13 @@ digests, although only two are currently supported: MIME digests and RFC 1153
(a.k.a. plain text) digests.
>>> from mailman.pipeline.to_digest import process
- >>> from mailman.queue import Switchboard
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
>>> mlist.web_page_url = u'http://www.example.com/'
>>> mlist.real_name = u'XTest'
>>> mlist.subject_prefix = u'[_XTest] '
>>> mlist.one_last_digest = set()
- >>> switchboard = Switchboard(config.VIRGINQUEUE_DIR)
+ >>> switchboard = config.switchboards['virgin']
This is a helper function used to iterate through all the accumulated digest
messages, in the order in which they were posted. This makes it easier to
@@ -406,11 +405,16 @@ When messages come in with a content-type character set different than that of
the list's preferred language, recipients wil get an internationalized
digest. French is not enabled by default site-wide, so enable that now.
-XXX We also have to set the default server language to French, otherwise the
-English template will be found and the masthead won't be translated.
-
>>> config.languages.enable_language('fr')
- >>> config.DEFAULT_SERVER_LANGUAGE = u'fr'
+
+ # Simulate the site administrator setting the default server language to
+ # French in the configuration file. Without this, the English template
+ # will be found and the masthead won't be translated.
+ >>> config.push('french', """
+ ... [mailman]
+ ... default_language: fr
+ ... """)
+
>>> mlist.preferred_language = u'fr'
>>> msg = message_from_string("""\
... From: aperson@example.org
diff --git a/mailman/pipeline/docs/nntp.txt b/mailman/pipeline/docs/nntp.txt
index 3ef3b2413..0120de394 100644
--- a/mailman/pipeline/docs/nntp.txt
+++ b/mailman/pipeline/docs/nntp.txt
@@ -5,11 +5,10 @@ Mailman has an NNTP gateway, whereby messages posted to the mailing list can
be forwarded onto an NNTP newsgroup. Typically this means Usenet, but since
NNTP is to Usenet as IP is to the web, it's more general than that.
- >>> from mailman.queue import Switchboard
>>> handler = config.handlers['to-usenet']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
- >>> switchboard = Switchboard(config.NEWSQUEUE_DIR)
+ >>> switchboard = config.switchboards['news']
Gatewaying from the mailing list to the newsgroup happens through a separate
'nntp' queue and happen immediately when the message is posted through to the
diff --git a/mailman/pipeline/docs/replybot.txt b/mailman/pipeline/docs/replybot.txt
index 7325417ed..f9f824e4e 100644
--- a/mailman/pipeline/docs/replybot.txt
+++ b/mailman/pipeline/docs/replybot.txt
@@ -13,8 +13,7 @@ message or the amount of time since the last auto-response.
>>> # Ensure that the virgin queue is empty, since we'll be checking this
>>> # for new auto-response messages.
- >>> from mailman.queue import Switchboard
- >>> virginq = Switchboard(config.VIRGINQUEUE_DIR)
+ >>> virginq = config.switchboards['virgin']
>>> virginq.files
[]
diff --git a/mailman/pipeline/docs/tagger.txt b/mailman/pipeline/docs/tagger.txt
index 64996755b..9f0bcd4b2 100644
--- a/mailman/pipeline/docs/tagger.txt
+++ b/mailman/pipeline/docs/tagger.txt
@@ -9,7 +9,6 @@ its Subject: and Keywords: headers compared against these regular
expressions. The message then gets tagged with the topic names of each hit.
>>> from mailman.pipeline.tagger import process
- >>> from mailman.queue import Switchboard
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Topics must be enabled for Mailman to do any topic matching, even if topics
diff --git a/mailman/pipeline/docs/to-outgoing.txt b/mailman/pipeline/docs/to-outgoing.txt
index 70f93cfae..046ed9be8 100644
--- a/mailman/pipeline/docs/to-outgoing.txt
+++ b/mailman/pipeline/docs/to-outgoing.txt
@@ -9,10 +9,9 @@ term somewhat incorrectly, but within the spirit of the standard, which
basically describes how to encode the recipient's address in the originator
headers for unambigous bounce processing.
- >>> from mailman.queue import Switchboard
>>> handler = config.handlers['to-outgoing']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
- >>> switchboard = Switchboard(config.OUTQUEUE_DIR)
+ >>> switchboard = config.switchboards['out']
>>> def queue_size():
... size = len(switchboard.files)