summaryrefslogtreecommitdiff
path: root/src/mailman/runners/docs
diff options
context:
space:
mode:
authorBarry Warsaw2014-04-28 11:23:35 -0400
committerBarry Warsaw2014-04-28 11:23:35 -0400
commitd4d71f71f08d6d440b17482eecc5472dcfe6cbae (patch)
tree71f08b3d60f698883294eaa6d1bf366a095da011 /src/mailman/runners/docs
parent7536530dcd8d6303c0a869e8c9c2cb2517b9b018 (diff)
downloadmailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.tar.gz
mailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.tar.zst
mailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.zip
Use print functions consistently through, and update all __future__ imports to
reflect this. Also, mock out sys.stderr on some tests so that their nose2 output is quieter. A few other minor coding style consistencies.
Diffstat (limited to 'src/mailman/runners/docs')
-rw-r--r--src/mailman/runners/docs/command.rst14
-rw-r--r--src/mailman/runners/docs/digester.rst10
-rw-r--r--src/mailman/runners/docs/incoming.rst28
-rw-r--r--src/mailman/runners/docs/lmtp.rst4
-rw-r--r--src/mailman/runners/docs/nntp.rst2
-rw-r--r--src/mailman/runners/docs/outgoing.rst4
6 files changed, 31 insertions, 31 deletions
diff --git a/src/mailman/runners/docs/command.rst b/src/mailman/runners/docs/command.rst
index 43682056b..a7a4da8ed 100644
--- a/src/mailman/runners/docs/command.rst
+++ b/src/mailman/runners/docs/command.rst
@@ -41,7 +41,7 @@ And now the response is in the ``virgin`` queue.
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
From: test-bounces@example.com
To: aperson@example.com
@@ -91,7 +91,7 @@ message is plain text.
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
From: test-bounces@example.com
To: bperson@example.com
@@ -144,7 +144,7 @@ address, and the other is the results of his email command.
>>> registrar = getUtility(IRegistrar)
>>> for item in messages:
... subject = item.msg['subject']
- ... print 'Subject:', subject
+ ... print('Subject:', subject)
... if 'confirm' in str(subject):
... token = str(subject).split()[1].strip()
... status = registrar.confirm(token)
@@ -171,7 +171,7 @@ Similarly, to leave a mailing list, the user need only email the ``-leave`` or
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
From: test-bounces@example.com
To: dperson@example.com
@@ -206,7 +206,7 @@ The ``-confirm`` address is also available as an implicit command.
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
From: test-bounces@example.com
To: dperson@example.com
@@ -250,7 +250,7 @@ looked at by the command queue.
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
...
<BLANKLINE>
@@ -282,7 +282,7 @@ The ``stop`` command is an alias for ``end``.
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: The results of your email commands
...
<BLANKLINE>
diff --git a/src/mailman/runners/docs/digester.rst b/src/mailman/runners/docs/digester.rst
index 96e8739e3..cd0fba67c 100644
--- a/src/mailman/runners/docs/digester.rst
+++ b/src/mailman/runners/docs/digester.rst
@@ -48,7 +48,7 @@ messages to put in the digest.
The marker message is empty.
- >>> print entry.msg.as_string()
+ >>> print(entry.msg.as_string())
But the message metadata has a reference to the digest file.
::
@@ -97,7 +97,7 @@ The MIME digest is a multipart, and the RFC 1153 digest is the other one.
The MIME digest has lots of good stuff, all contained in the multipart.
- >>> print mime.msg.as_string()
+ >>> print(mime.msg.as_string())
Content-Type: multipart/mixed; boundary="===============...=="
MIME-Version: 1.0
From: test-request@example.com
@@ -199,7 +199,7 @@ The MIME digest has lots of good stuff, all contained in the multipart.
The RFC 1153 contains the digest in a single plain text message.
- >>> print rfc1153.msg.as_string()
+ >>> print(rfc1153.msg.as_string())
From: test-request@example.com
Subject: Test Digest, Vol 1, Issue 1
To: test@example.com
@@ -342,7 +342,7 @@ One of which is the MIME digest and the other of which is the RFC 1153 digest.
You can see that the digests contain a mix of French and Japanese.
- >>> print mime.msg.as_string()
+ >>> print(mime.msg.as_string())
Content-Type: multipart/mixed; boundary="===============...=="
MIME-Version: 1.0
From: test-request@example.com
@@ -411,7 +411,7 @@ You can see that the digests contain a mix of French and Japanese.
The RFC 1153 digest will be encoded in UTF-8 since it contains a mixture of
French and Japanese characters.
- >>> print rfc1153.msg.as_string()
+ >>> print(rfc1153.msg.as_string())
From: test-request@example.com
Subject: Groupe Test, Vol 1, Parution 2
To: test@example.com
diff --git a/src/mailman/runners/docs/incoming.rst b/src/mailman/runners/docs/incoming.rst
index 8830031e6..0ae3336ca 100644
--- a/src/mailman/runners/docs/incoming.rst
+++ b/src/mailman/runners/docs/incoming.rst
@@ -12,7 +12,7 @@ posted to the mailing list. This chain is processed with the message
eventually ending up in one of the four disposition states described above.
>>> mlist = create_list('test@example.com')
- >>> print mlist.posting_chain
+ >>> print(mlist.posting_chain)
default-posting-chain
@@ -43,11 +43,11 @@ While configurable, the *sender addresses* by default are those named in the
>>> from zope.component import getUtility
>>> from mailman.interfaces.usermanager import IUserManager
>>> user_manager = getUtility(IUserManager)
- >>> print user_manager.get_address('xperson@example.com')
+ >>> print(user_manager.get_address('xperson@example.com'))
None
- >>> print user_manager.get_address('yperson@example.com')
+ >>> print(user_manager.get_address('yperson@example.com'))
None
- >>> print user_manager.get_address('zperson@example.com')
+ >>> print(user_manager.get_address('zperson@example.com'))
None
Inject the message into the incoming queue, similar to the way the upstream
@@ -69,10 +69,10 @@ not linked to a user and are unverified.
>>> for localpart in ('xperson', 'yperson', 'zperson'):
... email = '{0}@example.com'.format(localpart)
... address = user_manager.get_address(email)
- ... print '{0}; verified? {1}; user? {2}'.format(
- ... address.email,
- ... ('No' if address.verified_on is None else 'Yes'),
- ... user_manager.get_user(email))
+ ... print('{0}; verified? {1}; user? {2}'.format(
+ ... address.email,
+ ... ('No' if address.verified_on is None else 'Yes'),
+ ... user_manager.get_user(email)))
xperson@example.com; verified? No; user? None
yperson@example.com; verified? No; user? None
zperson@example.com; verified? No; user? None
@@ -116,7 +116,7 @@ Now the message is in the pipeline queue.
>>> messages = get_queue_messages('pipeline')
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
From: aperson@example.com
To: test@example.com
Subject: My first post
@@ -146,11 +146,11 @@ pipeline queue.
>>> from mailman.interfaces.chain import ChainEvent
>>> def on_chain(event):
... if isinstance(event, ChainEvent):
- ... print event
- ... print event.chain
- ... print 'From: {0}\nTo: {1}\nMessage-ID: {2}'.format(
+ ... print(event)
+ ... print(event.chain)
+ ... print('From: {0}\nTo: {1}\nMessage-ID: {2}'.format(
... event.msg['from'], event.msg['to'],
- ... event.msg['message-id'])
+ ... event.msg['message-id']))
>>> mlist.emergency = True
@@ -234,7 +234,7 @@ to the original sender.
>>> messages = get_queue_messages('virgin')
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
Subject: My first post
From: test-owner@example.com
To: aperson@example.com
diff --git a/src/mailman/runners/docs/lmtp.rst b/src/mailman/runners/docs/lmtp.rst
index 3ce145907..c2227581f 100644
--- a/src/mailman/runners/docs/lmtp.rst
+++ b/src/mailman/runners/docs/lmtp.rst
@@ -71,7 +71,7 @@ queue.
>>> messages = get_queue_messages('in')
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
From: anne.person@example.com
To: mylist@example.com
Subject: An interesting message
@@ -134,7 +134,7 @@ command queue for processing.
>>> messages = get_queue_messages('command')
>>> len(messages)
1
- >>> print messages[0].msg.as_string()
+ >>> print(messages[0].msg.as_string())
From: anne.person@example.com
To: mylist-request@example.com
Subject: Help
diff --git a/src/mailman/runners/docs/nntp.rst b/src/mailman/runners/docs/nntp.rst
index 31c7210cf..372fa5744 100644
--- a/src/mailman/runners/docs/nntp.rst
+++ b/src/mailman/runners/docs/nntp.rst
@@ -45,7 +45,7 @@ The message gets copied to the NNTP queue for preparation and posting.
The message was successfully posted the NNTP server.
- >>> print nntpd.get_message().as_string()
+ >>> print(nntpd.get_message().as_string())
From: aperson@example.com
To: test@example.com
Newsgroups: comp.lang.python
diff --git a/src/mailman/runners/docs/outgoing.rst b/src/mailman/runners/docs/outgoing.rst
index d8963ae00..a3220e423 100644
--- a/src/mailman/runners/docs/outgoing.rst
+++ b/src/mailman/runners/docs/outgoing.rst
@@ -74,7 +74,7 @@ Every recipient got the same copy of the message.
>>> len(messages)
1
- >>> print messages[0].as_string()
+ >>> print(messages[0].as_string())
From: aperson@example.com
To: test@example.com
Subject: My first post
@@ -119,7 +119,7 @@ recipients.
>>> from operator import itemgetter
>>> def show_headers(messages):
... for message in sorted(messages, key=itemgetter('x-rcptto')):
- ... print message['X-RcptTo'], message['X-MailFrom']
+ ... print(message['X-RcptTo'], message['X-MailFrom'])
>>> show_headers(messages)
aperson@example.com test-bounces@example.com