summaryrefslogtreecommitdiff
path: root/src/mailman/chains
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/chains
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 '')
-rw-r--r--src/mailman/chains/accept.py2
-rw-r--r--src/mailman/chains/discard.py2
-rw-r--r--src/mailman/chains/docs/moderation.rst18
-rw-r--r--src/mailman/chains/reject.py2
-rw-r--r--src/mailman/chains/tests/test_hold.py3
5 files changed, 14 insertions, 13 deletions
diff --git a/src/mailman/chains/accept.py b/src/mailman/chains/accept.py
index 97b6019a8..f5dd5a73d 100644
--- a/src/mailman/chains/accept.py
+++ b/src/mailman/chains/accept.py
@@ -17,7 +17,7 @@
"""The terminal 'accept' chain."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
diff --git a/src/mailman/chains/discard.py b/src/mailman/chains/discard.py
index 067eaa6a8..001b243ac 100644
--- a/src/mailman/chains/discard.py
+++ b/src/mailman/chains/discard.py
@@ -17,7 +17,7 @@
"""The terminal 'discard' chain."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
diff --git a/src/mailman/chains/docs/moderation.rst b/src/mailman/chains/docs/moderation.rst
index 1e968ee68..1fe7e40cb 100644
--- a/src/mailman/chains/docs/moderation.rst
+++ b/src/mailman/chains/docs/moderation.rst
@@ -38,7 +38,7 @@ set to moderate new member postings.
... DeliveryMode.regular, 'en')
>>> member
<Member: Anne <anne@example.com> on test@example.com as MemberRole.member>
- >>> print member.moderation_action
+ >>> print(member.moderation_action)
Action.defer
In order to find out whether the message is held or accepted, we can subscribe
@@ -48,15 +48,15 @@ to Zope events that are triggered on each case.
>>> from mailman.interfaces.chain import ChainEvent
>>> def on_chain(event):
... if isinstance(event, ChainEvent):
- ... print event
- ... print event.chain
- ... print 'Subject:', event.msg['subject']
- ... print 'Hits:'
+ ... print(event)
+ ... print(event.chain)
+ ... print('Subject:', event.msg['subject'])
+ ... print('Hits:')
... for hit in event.msgdata.get('rule_hits', []):
- ... print ' ', hit
- ... print 'Misses:'
+ ... print(' ', hit)
+ ... print('Misses:')
... for miss in event.msgdata.get('rule_misses', []):
- ... print ' ', miss
+ ... print(' ', miss)
Anne's post to the mailing list runs through the incoming runner's default
built-in chain. No rules hit and so the message is accepted.
@@ -218,5 +218,5 @@ moderator approval.
>>> nonmember = mlist.nonmembers.get_member('bart@example.com')
>>> nonmember
<Member: bart@example.com on test@example.com as MemberRole.nonmember>
- >>> print nonmember.moderation_action
+ >>> print(nonmember.moderation_action)
Action.hold
diff --git a/src/mailman/chains/reject.py b/src/mailman/chains/reject.py
index c229761a6..e24cedb85 100644
--- a/src/mailman/chains/reject.py
+++ b/src/mailman/chains/reject.py
@@ -17,7 +17,7 @@
"""The terminal 'reject' chain."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py
index a261a8860..a1fddd558 100644
--- a/src/mailman/chains/tests/test_hold.py
+++ b/src/mailman/chains/tests/test_hold.py
@@ -17,10 +17,11 @@
"""Additional tests for the hold chain."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
+ 'TestAutorespond',
]