summaryrefslogtreecommitdiff
path: root/Mailman/docs/digests.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/docs/digests.txt')
-rw-r--r--Mailman/docs/digests.txt38
1 files changed, 14 insertions, 24 deletions
diff --git a/Mailman/docs/digests.txt b/Mailman/docs/digests.txt
index 4d787221d..aaef4c18b 100644
--- a/Mailman/docs/digests.txt
+++ b/Mailman/docs/digests.txt
@@ -7,18 +7,14 @@ digests, although only two are currently supported: MIME digests and RFC 1153
(a.k.a. plain text) digests.
>>> from Mailman.Handlers.ToDigest import process
- >>> from Mailman.Message import Message
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
- >>> from Mailman.database import flush
- >>> from email import message_from_string
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
- >>> mlist.preferred_language = 'en'
- >>> mlist.web_page_url = 'http://www.example.com/'
- >>> mlist.real_name = 'XTest'
- >>> mlist.subject_prefix = '[_XTest] '
+ >>> 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()
- >>> flush()
>>> switchboard = Switchboard(config.VIRGINQUEUE_DIR)
This is a helper function used to iterate through all the accumulated digest
@@ -45,7 +41,7 @@ update the tests when we switch to a different mailbox format.
...
... Here is message $i
... """).substitute(i=i)
- ... yield message_from_string(text, Message)
+ ... yield message_from_string(text)
Short circuiting
@@ -59,7 +55,6 @@ storing of posted messages to the mailbox. For example, the mailing list may
not allow digests...
>>> mlist.digestable = False
- >>> flush()
>>> msg = makemsg().next()
>>> process(mlist, msg, {})
>>> sum(1 for mboxmsg in digest_mbox())
@@ -70,7 +65,6 @@ not allow digests...
...or they may allow digests but the message is already a digest.
>>> mlist.digestable = True
- >>> flush()
>>> process(mlist, msg, dict(isdigest=True))
>>> sum(1 for mboxmsg in digest_mbox())
0
@@ -87,7 +81,6 @@ triggering the sending of the digest. If none of those criteria are met, then
the message will just sit in the mailbox for a while.
>>> mlist.digest_size_threshold = 10000
- >>> flush()
>>> process(mlist, msg, {})
>>> switchboard.files
[]
@@ -102,7 +95,6 @@ digest and an RFC 1153 plain text digest. The size threshold is in KB.
>>> mlist.digest_size_threshold = 1
>>> mlist.volume = 2
>>> mlist.next_digest_number = 10
- >>> flush()
>>> size = 0
>>> for msg in makemsg():
... process(mlist, msg, {})
@@ -274,7 +266,7 @@ digest and an RFC 1153 plain text digest. The size threshold is in KB.
>>> sorted(mimedata.items())
[('_parsemsg', False),
('isdigest', True),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('recips', set([])), ('version', 3)]
>>> print rfc1153msg.as_string()
@@ -409,7 +401,7 @@ digest and an RFC 1153 plain text digest. The size threshold is in KB.
>>> sorted(rfc1153data.items())
[('_parsemsg', False),
('isdigest', True),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('recips', set([])), ('version', 3)]
@@ -425,9 +417,8 @@ 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 = 'fr'
- >>> mlist.preferred_language = 'fr'
- >>> flush()
+ >>> config.DEFAULT_SERVER_LANGUAGE = u'fr'
+ >>> mlist.preferred_language = u'fr'
>>> msg = message_from_string("""\
... From: aperson@example.org
... To: _xtest@example.com
@@ -437,12 +428,11 @@ English template will be found and the masthead won't be translated.
... Content-Transfer-Encoding: 7bit
...
... \x1b$B0lHV\x1b(B
- ... """, Message)
+ ... """)
Set the digest threshold to zero so that the digests will be sent immediately.
>>> mlist.digest_size_threshold = 0
- >>> flush()
>>> process(mlist, msg, {})
>>> sum(1 for mboxmsg in digest_mbox())
0
@@ -522,7 +512,7 @@ Set the digest threshold to zero so that the digests will be sent immediately.
>>> sorted(mimedata.items())
[('_parsemsg', False),
('isdigest', True),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('recips', set([])), ('version', 3)]
>>> print rfc1153msg.as_string()
@@ -541,7 +531,7 @@ Set the digest threshold to zero so that the digests will be sent immediately.
>>> sorted(rfc1153data.items())
[('_parsemsg', False),
('isdigest', True),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('recips', set([])), ('version', 3)]
@@ -549,4 +539,4 @@ Set the digest threshold to zero so that the digests will be sent immediately.
Clean up
--------
- >>> config.DEFAULT_SERVER_LANGUAGE = 'en'
+ >>> config.DEFAULT_SERVER_LANGUAGE = u'en'