summaryrefslogtreecommitdiff
path: root/mailman/options.py
diff options
context:
space:
mode:
Diffstat (limited to 'mailman/options.py')
-rw-r--r--mailman/options.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mailman/options.py b/mailman/options.py
index 8d752bfb5..5431b2da8 100644
--- a/mailman/options.py
+++ b/mailman/options.py
@@ -17,10 +17,13 @@
"""Common argument parsing."""
+from __future__ import unicode_literals
+
__metaclass__ = type
__all__ = [
'Options',
'SingleMailingListOptions',
+ 'MultipleMailingListOptions',
]
@@ -44,13 +47,13 @@ def check_unicode(option, opt, value):
return value.decode(sys.getdefaultencoding())
except UnicodeDecodeError:
raise OptionValueError(
- 'option %s: Cannot decode: %r' % (opt, value))
+ 'option {0}: Cannot decode: {1}'.format(opt, value))
def check_yesno(option, opt, value):
value = value.lower()
if value not in ('yes', 'no', 'y', 'n'):
- raise OptionValueError('option s: invalid: %r' % (opt, value))
+ raise OptionValueError('option {0}: invalid: {1}'.format(opt, value))
return value[0] == 'y'
@@ -92,8 +95,9 @@ class Options:
def add_common_options(self):
"""Add options common to all scripts."""
+ # Python requires str types here.
self.parser.add_option(
- '-C', '--config',
+ str('-C'), str('--config'),
help=_('Alternative configuration file to use'))
def initialize(self, propagate_logs=None):
@@ -135,6 +139,5 @@ class MultipleMailingListOptions(Options):
self.parser.add_option(
'-l', '--listname',
default=[], action='append', dest='listnames', type='unicode',
- help=("""\
+ help=_("""\
A mailing list name. It is okay to have multiple --listname options."""))
-