diff options
Diffstat (limited to 'src/mailman/commands')
| -rw-r--r-- | src/mailman/commands/cli_import.py | 7 | ||||
| -rw-r--r-- | src/mailman/commands/cli_inject.py | 9 | ||||
| -rw-r--r-- | src/mailman/commands/cli_qfile.py | 8 | ||||
| -rw-r--r-- | src/mailman/commands/docs/echo.rst | 2 | ||||
| -rw-r--r-- | src/mailman/commands/docs/help.rst | 8 | ||||
| -rw-r--r-- | src/mailman/commands/docs/membership.rst | 18 | ||||
| -rw-r--r-- | src/mailman/commands/tests/test_conf.py | 2 | ||||
| -rw-r--r-- | src/mailman/commands/tests/test_help.py | 8 |
8 files changed, 29 insertions, 33 deletions
diff --git a/src/mailman/commands/cli_import.py b/src/mailman/commands/cli_import.py index 5e25cd4fe..b53faea96 100644 --- a/src/mailman/commands/cli_import.py +++ b/src/mailman/commands/cli_import.py @@ -26,16 +26,15 @@ __all__ = [ import sys -import cPickle - -from zope.component import getUtility -from zope.interface import implementer from mailman.core.i18n import _ from mailman.database.transaction import transactional from mailman.interfaces.command import ICLISubCommand from mailman.interfaces.listmanager import IListManager from mailman.utilities.importer import import_config_pck, Import21Error +from six.moves import cPickle +from zope.component import getUtility +from zope.interface import implementer diff --git a/src/mailman/commands/cli_inject.py b/src/mailman/commands/cli_inject.py index 07ef0ec6c..9339dc074 100644 --- a/src/mailman/commands/cli_inject.py +++ b/src/mailman/commands/cli_inject.py @@ -27,14 +27,13 @@ __all__ = [ import sys -from zope.component import getUtility -from zope.interface import implementer - from mailman.app.inject import inject_text from mailman.config import config from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand from mailman.interfaces.listmanager import IListManager +from zope.component import getUtility +from zope.interface import implementer @@ -49,7 +48,7 @@ class Inject: self.parser = parser command_parser.add_argument( '-q', '--queue', - type=unicode, help=_(""" + help=_(""" The name of the queue to inject the message to. QUEUE must be one of the directories inside the qfiles directory. If omitted, the incoming queue is used.""")) @@ -59,7 +58,7 @@ class Inject: help=_('Show a list of all available queue names and exit.')) command_parser.add_argument( '-f', '--filename', - type=unicode, help=_(""" + help=_(""" Name of file containing the message to inject. If not given, or '-' (without the quotes) standard input is used.""")) # Required positional argument. diff --git a/src/mailman/commands/cli_qfile.py b/src/mailman/commands/cli_qfile.py index 986898bee..c4ff66aea 100644 --- a/src/mailman/commands/cli_qfile.py +++ b/src/mailman/commands/cli_qfile.py @@ -25,14 +25,12 @@ __all__ = [ ] -import cPickle - -from pprint import PrettyPrinter -from zope.interface import implementer - from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand from mailman.utilities.interact import interact +from pprint import PrettyPrinter +from six.moves import cPickle +from zope.interface import implementer m = [] diff --git a/src/mailman/commands/docs/echo.rst b/src/mailman/commands/docs/echo.rst index 32399ebfc..686accf2c 100644 --- a/src/mailman/commands/docs/echo.rst +++ b/src/mailman/commands/docs/echo.rst @@ -24,7 +24,7 @@ The original message is ignored, but the results receive the echoed command. >>> from mailman.email.message import Message >>> print(command.process(mlist, Message(), {}, ('foo', 'bar'), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> echo foo bar diff --git a/src/mailman/commands/docs/help.rst b/src/mailman/commands/docs/help.rst index bbd6c8c09..35ba87caa 100644 --- a/src/mailman/commands/docs/help.rst +++ b/src/mailman/commands/docs/help.rst @@ -25,7 +25,7 @@ short description of each of them. >>> from mailman.email.message import Message >>> print(help.process(mlist, Message(), {}, (), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> confirm - Confirm a subscription request. @@ -44,19 +44,19 @@ With an argument, you can get more detailed help about a specific command. >>> results = Results() >>> print(help.process(mlist, Message(), {}, ('help',), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> help [command] Get help about available email commands. <BLANKLINE> - + Some commands have even more detailed help. >>> results = Results() >>> print(help.process(mlist, Message(), {}, ('join',), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> join [digest=<no|mime|plain>] diff --git a/src/mailman/commands/docs/membership.rst b/src/mailman/commands/docs/membership.rst index aa3ab97e6..3fe9b05ba 100644 --- a/src/mailman/commands/docs/membership.rst +++ b/src/mailman/commands/docs/membership.rst @@ -45,7 +45,7 @@ If that's missing though, then an error is returned. >>> from mailman.email.message import Message >>> print(join.process(mlist, Message(), {}, (), results)) ContinueProcessing.no - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> join: No valid address found to subscribe @@ -60,7 +60,7 @@ The ``subscribe`` command is an alias. >>> results = Results() >>> print(subscribe.process(mlist, Message(), {}, (), results)) ContinueProcessing.no - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> subscribe: No valid address found to subscribe @@ -79,7 +79,7 @@ When the message has a From field, that address will be subscribed. >>> results = Results() >>> print(join.process(mlist, msg, {}, (), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Confirmation email sent to Anne Person <anne@example.com> @@ -150,7 +150,7 @@ list. >>> results = Results() >>> print(confirm.process(mlist, msg, {}, (token,), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Confirmed @@ -208,7 +208,7 @@ list. >>> results = Results() >>> print(confirm.process(mlist_2, msg, {}, (token,), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Confirmed @@ -241,7 +241,7 @@ is sent a confirmation message for her request. >>> results = Results() >>> print(leave.process(mlist_2, msg, {}, (), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Anne Person <anne@example.com> left baker@example.com @@ -278,7 +278,7 @@ to unsubscribe Anne from the alpha mailing list. >>> print(leave.process(mlist, msg, {}, (), results)) ContinueProcessing.no - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Invalid or unverified email address: anne.person@example.org @@ -299,7 +299,7 @@ unsubscribe her from the list. >>> print(leave.process(mlist, msg, {}, (), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Anne Person <anne.person@example.org> left alpha@example.com @@ -354,7 +354,7 @@ a user of the system. >>> print(confirm.process(mlist, msg, {}, (token,), results)) ContinueProcessing.yes - >>> print(unicode(results)) + >>> print(results.decode('utf-8')) The results of your email command are provided below. <BLANKLINE> Confirmed diff --git a/src/mailman/commands/tests/test_conf.py b/src/mailman/commands/tests/test_conf.py index 12ed5c537..cc0f61ba2 100644 --- a/src/mailman/commands/tests/test_conf.py +++ b/src/mailman/commands/tests/test_conf.py @@ -31,9 +31,9 @@ import mock import tempfile import unittest -from StringIO import StringIO from mailman.commands.cli_conf import Conf from mailman.testing.layers import ConfigLayer +from six import StringIO diff --git a/src/mailman/commands/tests/test_help.py b/src/mailman/commands/tests/test_help.py index 3c7d1ae9f..74eaae84e 100644 --- a/src/mailman/commands/tests/test_help.py +++ b/src/mailman/commands/tests/test_help.py @@ -47,11 +47,11 @@ class TestHelp(unittest.TestCase): def test_too_many_arguments(self): # Error message when too many help arguments are given. results = Results() - status = self._help.process(self._mlist, Message(), {}, + status = self._help.process(self._mlist, Message(), {}, ('more', 'than', 'one'), results) self.assertEqual(status, ContinueProcessing.no) - self.assertEqual(unicode(results), """\ + self.assertEqual(results.decode('utf-8'), """\ The results of your email command are provided below. help: too many arguments: more than one @@ -60,10 +60,10 @@ help: too many arguments: more than one def test_no_such_command(self): # Error message when asking for help on an existent command. results = Results() - status = self._help.process(self._mlist, Message(), {}, + status = self._help.process(self._mlist, Message(), {}, ('doesnotexist',), results) self.assertEqual(status, ContinueProcessing.no) - self.assertEqual(unicode(results), """\ + self.assertEqual(results.decode('utf-8'), """\ The results of your email command are provided below. help: no such command: doesnotexist |
