diff options
| author | Barry Warsaw | 2012-04-22 17:33:33 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-22 17:33:33 -0400 |
| commit | 4488631dff02731ff03f2fef01ee27bbd944812b (patch) | |
| tree | a4064e30019764ffac7f5d65893b49779cb6918b /src/mailman/commands/cli_import.py | |
| parent | 7da6bb2bdba138877e53a70d224b253af14c65bc (diff) | |
| parent | cd3bab07fe2de591fee0dd27e9d47076a7e7db0f (diff) | |
| download | mailman-4488631dff02731ff03f2fef01ee27bbd944812b.tar.gz mailman-4488631dff02731ff03f2fef01ee27bbd944812b.tar.zst mailman-4488631dff02731ff03f2fef01ee27bbd944812b.zip | |
Diffstat (limited to 'src/mailman/commands/cli_import.py')
| -rw-r--r-- | src/mailman/commands/cli_import.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailman/commands/cli_import.py b/src/mailman/commands/cli_import.py index b703f3ffd..716a8ede1 100644 --- a/src/mailman/commands/cli_import.py +++ b/src/mailman/commands/cli_import.py @@ -17,7 +17,7 @@ """Importing list data into Mailman 3.""" -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ @@ -31,8 +31,8 @@ import cPickle from zope.component import getUtility from zope.interface import implements -from mailman.config import config 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 @@ -59,6 +59,7 @@ class Import21: 'pickle_file', metavar='FILENAME', nargs=1, help=_('The path to the config.pck file to import.')) + @transactional def process(self, args): """See `ICLISubCommand`.""" # Could be None or sequence of length 0. @@ -90,10 +91,7 @@ class Import21: return else: if not isinstance(config_dict, dict): - print >> sys.stderr, _( - 'Ignoring non-dictionary: {0!r}').format( - config_dict) + print(_('Ignoring non-dictionary: {0!r}').format( + config_dict), file=sys.stderr) continue import_config_pck(mlist, config_dict) - # Commit the changes to the database. - config.db.commit() |
