summaryrefslogtreecommitdiff
path: root/src/mailman/options.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-06-30 23:14:26 -0400
committerBarry Warsaw2009-06-30 23:14:26 -0400
commit80fa4158997a8d6aa02a281bb1732417bee1b8a9 (patch)
treef58adb4d5003a04b10d6bf3a1aaa9081e18c10b1 /src/mailman/options.py
parentfc07eb2b464eaea1f3dcc9ce4d57343571e8527f (diff)
downloadmailman-80fa4158997a8d6aa02a281bb1732417bee1b8a9.tar.gz
mailman-80fa4158997a8d6aa02a281bb1732417bee1b8a9.tar.zst
mailman-80fa4158997a8d6aa02a281bb1732417bee1b8a9.zip
Diffstat (limited to 'src/mailman/options.py')
-rw-r--r--src/mailman/options.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mailman/options.py b/src/mailman/options.py
index d18c78cea..41c3651e4 100644
--- a/src/mailman/options.py
+++ b/src/mailman/options.py
@@ -17,7 +17,7 @@
"""Common argument parsing."""
-from __future__ import unicode_literals
+from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
@@ -40,7 +40,9 @@ from mailman.version import MAILMAN_VERSION
+# pylint: disable-msg=W0613
def check_unicode(option, opt, value):
+ """Check that the value is a unicode string."""
if isinstance(value, unicode):
return value
try:
@@ -50,7 +52,9 @@ def check_unicode(option, opt, value):
'option {0}: Cannot decode: {1}'.format(opt, value))
+# pylint: disable-msg=W0613
def check_yesno(option, opt, value):
+ """Check that the value is 'yes' or 'no'."""
value = value.lower()
if value not in ('yes', 'no', 'y', 'n'):
raise OptionValueError('option {0}: invalid: {1}'.format(opt, value))
@@ -73,6 +77,7 @@ class SafeOptionParser(OptionParser):
having to wrap the options in str() calls.
"""
def add_option(self, *args, **kwargs):
+ """See `OptionParser`."""
# Check to see if the first or first two options are unicodes and turn
# them into 8-bit strings before calling the superclass's method.
if len(args) == 0:
@@ -150,6 +155,7 @@ class SingleMailingListOptions(Options):
"""A helper for specifying the mailing list on the command line."""
def add_options(self):
+ """See `Options`."""
self.parser.add_option(
'-l', '--listname',
type='unicode', help=_('The mailing list name'))
@@ -160,6 +166,7 @@ class MultipleMailingListOptions(Options):
"""A helper for specifying multiple mailing lists on the command line."""
def add_options(self):
+ """See `Options`."""
self.parser.add_option(
'-l', '--listname',
default=[], action='append', dest='listnames', type='unicode',