summaryrefslogtreecommitdiff
path: root/mailman/pipeline/docs
diff options
context:
space:
mode:
Diffstat (limited to 'mailman/pipeline/docs')
-rw-r--r--mailman/pipeline/docs/ack-headers.txt1
-rw-r--r--mailman/pipeline/docs/acknowledge.txt4
-rw-r--r--mailman/pipeline/docs/after-delivery.txt1
-rw-r--r--mailman/pipeline/docs/archives.txt4
-rw-r--r--mailman/pipeline/docs/avoid-duplicates.txt1
-rw-r--r--mailman/pipeline/docs/calc-recips.txt1
-rw-r--r--mailman/pipeline/docs/cleanse.txt1
-rw-r--r--mailman/pipeline/docs/cook-headers.txt1
-rw-r--r--mailman/pipeline/docs/decorate.txt1
-rw-r--r--mailman/pipeline/docs/digests.txt17
-rw-r--r--mailman/pipeline/docs/file-recips.txt1
-rw-r--r--mailman/pipeline/docs/filtering.txt1
-rw-r--r--mailman/pipeline/docs/nntp.txt4
-rw-r--r--mailman/pipeline/docs/reply-to.txt1
-rw-r--r--mailman/pipeline/docs/replybot.txt4
-rw-r--r--mailman/pipeline/docs/scrubber.txt6
-rw-r--r--mailman/pipeline/docs/subject-munging.txt1
-rw-r--r--mailman/pipeline/docs/tagger.txt2
-rw-r--r--mailman/pipeline/docs/to-outgoing.txt23
19 files changed, 28 insertions, 47 deletions
diff --git a/mailman/pipeline/docs/ack-headers.txt b/mailman/pipeline/docs/ack-headers.txt
index 28a8eed9e..ca41df03e 100644
--- a/mailman/pipeline/docs/ack-headers.txt
+++ b/mailman/pipeline/docs/ack-headers.txt
@@ -7,7 +7,6 @@ transformations. Some headers get added, others get changed. Some of these
changes depend on mailing list settings and others depend on how the message
is getting sent through the system. We'll take things one-by-one.
- >>> from mailman.configuration import config
>>> from mailman.pipeline.cook_headers import process
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.subject_prefix = u''
diff --git a/mailman/pipeline/docs/acknowledge.txt b/mailman/pipeline/docs/acknowledge.txt
index 76c8fdf21..d1206b6f3 100644
--- a/mailman/pipeline/docs/acknowledge.txt
+++ b/mailman/pipeline/docs/acknowledge.txt
@@ -5,7 +5,6 @@ When a user posts a message to a mailing list, and that user has chosen to
receive acknowledgments of their postings, Mailman will sent them such an
acknowledgment.
- >>> from mailman.configuration import config
>>> handler = config.handlers['acknowledge']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.real_name = u'XTest'
@@ -16,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/after-delivery.txt b/mailman/pipeline/docs/after-delivery.txt
index 5bc9b5936..b910e89a6 100644
--- a/mailman/pipeline/docs/after-delivery.txt
+++ b/mailman/pipeline/docs/after-delivery.txt
@@ -6,7 +6,6 @@ by the rest of the handlers in the incoming queue pipeline, a couple of
bookkeeping pieces of information are updated.
>>> import datetime
- >>> from mailman.configuration import config
>>> handler = config.handlers['after-delivery']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> post_time = datetime.datetime.now() - datetime.timedelta(minutes=10)
diff --git a/mailman/pipeline/docs/archives.txt b/mailman/pipeline/docs/archives.txt
index 67ad45c89..d81f6e27b 100644
--- a/mailman/pipeline/docs/archives.txt
+++ b/mailman/pipeline/docs/archives.txt
@@ -8,11 +8,9 @@ archivers to work in a separate process from the main Mailman delivery
processes.
>>> from mailman.app.lifecycle import create_list
- >>> from mailman.configuration import config
- >>> 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/avoid-duplicates.txt b/mailman/pipeline/docs/avoid-duplicates.txt
index 9fd332d1b..e1d31716a 100644
--- a/mailman/pipeline/docs/avoid-duplicates.txt
+++ b/mailman/pipeline/docs/avoid-duplicates.txt
@@ -6,7 +6,6 @@ reduce the reception of duplicate messages. It does this by removing certain
recipients from the list of recipients that earlier handler modules
(e.g. CalcRecips) calculates.
- >>> from mailman.configuration import config
>>> handler = config.handlers['avoid-duplicates']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
diff --git a/mailman/pipeline/docs/calc-recips.txt b/mailman/pipeline/docs/calc-recips.txt
index 057351873..550edff51 100644
--- a/mailman/pipeline/docs/calc-recips.txt
+++ b/mailman/pipeline/docs/calc-recips.txt
@@ -5,7 +5,6 @@ Every message that makes it through to the list membership gets sent to a set
of recipient addresses. These addresses are calculated by one of the handler
modules and depends on a host of factors.
- >>> from mailman.configuration import config
>>> handler = config.handlers['calculate-recipients']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
diff --git a/mailman/pipeline/docs/cleanse.txt b/mailman/pipeline/docs/cleanse.txt
index 1597095b3..0940cdb4b 100644
--- a/mailman/pipeline/docs/cleanse.txt
+++ b/mailman/pipeline/docs/cleanse.txt
@@ -5,7 +5,6 @@ All messages posted to a list get their headers cleansed. Some headers are
related to additional permissions that can be granted to the message and other
headers can be used to fish for membership.
- >>> from mailman.configuration import config
>>> handler = config.handlers['cleanse']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
diff --git a/mailman/pipeline/docs/cook-headers.txt b/mailman/pipeline/docs/cook-headers.txt
index 4fbdf58bb..985214079 100644
--- a/mailman/pipeline/docs/cook-headers.txt
+++ b/mailman/pipeline/docs/cook-headers.txt
@@ -8,7 +8,6 @@ changes depend on mailing list settings and others depend on how the message
is getting sent through the system. We'll take things one-by-one.
>>> from mailman.pipeline.cook_headers import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.subject_prefix = u''
>>> mlist.include_list_post_header = False
diff --git a/mailman/pipeline/docs/decorate.txt b/mailman/pipeline/docs/decorate.txt
index 60afb0170..b805e23cf 100644
--- a/mailman/pipeline/docs/decorate.txt
+++ b/mailman/pipeline/docs/decorate.txt
@@ -6,7 +6,6 @@ original message. A handler module takes care of this based on the settings
of the mailing list and the type of message being processed.
>>> from mailman.pipeline.decorate import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> msg_text = """\
... From: aperson@example.org
diff --git a/mailman/pipeline/docs/digests.txt b/mailman/pipeline/docs/digests.txt
index df01379b9..1d7112fd5 100644
--- a/mailman/pipeline/docs/digests.txt
+++ b/mailman/pipeline/docs/digests.txt
@@ -7,15 +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
- >>> from mailman.configuration import config
>>> 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
@@ -407,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/file-recips.txt b/mailman/pipeline/docs/file-recips.txt
index e93bba9aa..d006151ba 100644
--- a/mailman/pipeline/docs/file-recips.txt
+++ b/mailman/pipeline/docs/file-recips.txt
@@ -5,7 +5,6 @@ Mailman can calculate the recipients for a message from a Sendmail-style
include file. This file must be called members.txt and it must live in the
list's data directory.
- >>> from mailman.configuration import config
>>> handler = config.handlers['file-recipients']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
diff --git a/mailman/pipeline/docs/filtering.txt b/mailman/pipeline/docs/filtering.txt
index c5dca1531..70ca3098d 100644
--- a/mailman/pipeline/docs/filtering.txt
+++ b/mailman/pipeline/docs/filtering.txt
@@ -7,7 +7,6 @@ message. It does this with the MimeDel handler module, although other
handlers can potentially do other kinds of finer level content filtering.
>>> from mailman.pipeline.mime_delete import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
diff --git a/mailman/pipeline/docs/nntp.txt b/mailman/pipeline/docs/nntp.txt
index 5652d7924..0120de394 100644
--- a/mailman/pipeline/docs/nntp.txt
+++ b/mailman/pipeline/docs/nntp.txt
@@ -5,12 +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
- >>> from mailman.configuration import config
>>> 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/reply-to.txt b/mailman/pipeline/docs/reply-to.txt
index ad9100ce1..570ffb7ea 100644
--- a/mailman/pipeline/docs/reply-to.txt
+++ b/mailman/pipeline/docs/reply-to.txt
@@ -8,7 +8,6 @@ changes depend on mailing list settings and others depend on how the message
is getting sent through the system. We'll take things one-by-one.
>>> from mailman.pipeline.cook_headers import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.subject_prefix = u''
diff --git a/mailman/pipeline/docs/replybot.txt b/mailman/pipeline/docs/replybot.txt
index 2e3765cab..f9f824e4e 100644
--- a/mailman/pipeline/docs/replybot.txt
+++ b/mailman/pipeline/docs/replybot.txt
@@ -7,15 +7,13 @@ responses are subject to various conditions, such as headers in the original
message or the amount of time since the last auto-response.
>>> from mailman.pipeline.replybot import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.real_name = u'XTest'
>>> mlist.web_page_url = u'http://www.example.com/'
>>> # 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/scrubber.txt b/mailman/pipeline/docs/scrubber.txt
index 744925f34..eddd1939d 100644
--- a/mailman/pipeline/docs/scrubber.txt
+++ b/mailman/pipeline/docs/scrubber.txt
@@ -7,7 +7,6 @@ scrub attachments from messages so that binary goop doesn't end up in an
archive message.
>>> from mailman.pipeline.scrubber import process, save_attachment
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
@@ -51,7 +50,8 @@ filename suggested in the message's Content-Disposition: header or not. If
enabled, the filename will be used when this header attribute is present (yes,
this is an unfortunate double negative).
- >>> config.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME = False
+ >>> from mailman import Defaults
+ >>> Defaults.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME = False
>>> msg = message_from_string("""\
... Content-Type: image/gif; name="xtest.gif"
... Content-Transfer-Encoding: base64
@@ -80,7 +80,7 @@ The site administrator can also configure Mailman to ignore the
Content-Disposition: filename. This is the default for reasons described in
the Defaults.py.in file.
- >>> config.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME = True
+ >>> Defaults.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME = True
>>> msg = message_from_string("""\
... Content-Type: image/gif; name="xtest.gif"
... Content-Transfer-Encoding: base64
diff --git a/mailman/pipeline/docs/subject-munging.txt b/mailman/pipeline/docs/subject-munging.txt
index 02677d6e2..b2972683b 100644
--- a/mailman/pipeline/docs/subject-munging.txt
+++ b/mailman/pipeline/docs/subject-munging.txt
@@ -8,7 +8,6 @@ changes depend on mailing list settings and others depend on how the message
is getting sent through the system. We'll take things one-by-one.
>>> from mailman.pipeline.cook_headers import process
- >>> from mailman.configuration import config
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.subject_prefix = u''
diff --git a/mailman/pipeline/docs/tagger.txt b/mailman/pipeline/docs/tagger.txt
index 778f7cc73..9f0bcd4b2 100644
--- a/mailman/pipeline/docs/tagger.txt
+++ b/mailman/pipeline/docs/tagger.txt
@@ -9,8 +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
- >>> from mailman.configuration import config
>>> 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 3840b71ee..81e870e6c 100644
--- a/mailman/pipeline/docs/to-outgoing.txt
+++ b/mailman/pipeline/docs/to-outgoing.txt
@@ -9,11 +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
- >>> from mailman.configuration import config
>>> 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)
@@ -67,8 +65,9 @@ option to VERP personalized deliveries is set, then the message will be
VERP'd.
# Save the original value for clean up.
- >>> verp_personalized_delivieries = config.VERP_PERSONALIZED_DELIVERIES
- >>> config.VERP_PERSONALIZED_DELIVERIES = True
+ >>> from mailman import Defaults
+ >>> verp_personalized_delivieries = Defaults.VERP_PERSONALIZED_DELIVERIES
+ >>> Defaults.VERP_PERSONALIZED_DELIVERIES = True
>>> from mailman.interfaces import Personalization
>>> mlist.personalize = Personalization.individual
>>> msgdata = dict(foo=1, bar=2)
@@ -81,7 +80,7 @@ VERP'd.
However, if the global configuration variable prohibits VERP'ing, even
personalized lists will not VERP.
- >>> config.VERP_PERSONALIZED_DELIVERIES = False
+ >>> Defaults.VERP_PERSONALIZED_DELIVERIES = False
>>> msgdata = dict(foo=1, bar=2)
>>> handler.process(mlist, msg, msgdata)
>>> print msgdata.get('verp')
@@ -95,8 +94,8 @@ Mailman how often to VERP even non-personalized mailing lists. It can be set
to zero, which means non-personalized messages will never be VERP'd.
# Save the original value for clean up.
- >>> verp_delivery_interval = config.VERP_DELIVERY_INTERVAL
- >>> config.VERP_DELIVERY_INTERVAL = 0
+ >>> verp_delivery_interval = Defaults.VERP_DELIVERY_INTERVAL
+ >>> Defaults.VERP_DELIVERY_INTERVAL = 0
>>> mlist.personalize = Personalization.none
>>> msgdata = dict(foo=1, bar=2)
>>> handler.process(mlist, msg, msgdata)
@@ -107,7 +106,7 @@ to zero, which means non-personalized messages will never be VERP'd.
If the interval is set to 1, then every message will be VERP'd.
- >>> config.VERP_DELIVERY_INTERVAL = 1
+ >>> Defaults.VERP_DELIVERY_INTERVAL = 1
>>> for i in range(10):
... msgdata = dict(foo=1, bar=2)
... handler.process(mlist, msg, msgdata)
@@ -128,7 +127,7 @@ If the interval is set to 1, then every message will be VERP'd.
If the interval is set to some other number, then one out of that many posts
will be VERP'd.
- >>> config.VERP_DELIVERY_INTERVAL = 3
+ >>> Defaults.VERP_DELIVERY_INTERVAL = 3
>>> for i in range(10):
... mlist.post_id = i
... msgdata = dict(foo=1, bar=2)
@@ -151,5 +150,5 @@ will be VERP'd.
Clean up
========
- >>> config.VERP_PERSONALIZED_DELIVERIES = verp_personalized_delivieries
- >>> config.VERP_DELIVERY_INTERVAL = verp_delivery_interval
+ >>> Defaults.VERP_PERSONALIZED_DELIVERIES = verp_personalized_delivieries
+ >>> Defaults.VERP_DELIVERY_INTERVAL = verp_delivery_interval