aboutsummaryrefslogtreecommitdiffstats
path: root/bin/config_list
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-02-22 17:51:37 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-02-22 17:51:37 +0900
commit6aaafb6c05840389f1dd9139da9694f3b43c57df (patch)
tree3ca127f0bd34ede1ff388fa529fffad522d424d8 /bin/config_list
parent3c78c57cc88877f701a935ce009efd39d31925e6 (diff)
downloadmailman2-6aaafb6c05840389f1dd9139da9694f3b43c57df.tar.gz
mailman2-6aaafb6c05840389f1dd9139da9694f3b43c57df.tar.xz
mailman2-6aaafb6c05840389f1dd9139da9694f3b43c57df.zip
Importing locale patch for command line utils, from RHEL6 rpm source
(for -japan-poem, originally imported from 2.1.12-18 package for RHEL6 rpm source)
Diffstat (limited to '')
-rw-r--r--bin/config_list29
1 files changed, 15 insertions, 14 deletions
diff --git a/bin/config_list b/bin/config_list
index 25d4fb62..e23dac24 100644
--- a/bin/config_list
+++ b/bin/config_list
@@ -76,6 +76,7 @@ from Mailman import Errors
from Mailman import i18n
_ = i18n._
+C_ = i18n.C_
NL = '\n'
nonasciipat = re.compile(r'[\x80-\xff]')
@@ -87,7 +88,7 @@ def usage(code, msg=''):
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -106,7 +107,7 @@ def do_output(listname, outfile):
try:
mlist = MailList.MailList(listname, lock=0)
except Errors.MMListError:
- usage(1, _('No such list: %(listname)s'))
+ usage(1, C_('No such list: %(listname)s'))
# Preamble for the config info. PEP263 charset and capture time.
language = mlist.preferred_language
charset = Utils.GetCharSet(language)
@@ -114,7 +115,7 @@ def do_output(listname, outfile):
if not charset:
charset = 'us-ascii'
when = time.ctime(time.time())
- print >> outfp, _('''\
+ print >> outfp, C_('''\
# -*- python -*-
# -*- coding: %(charset)s -*-
## "%(listname)s" mailing list configuration settings
@@ -140,7 +141,7 @@ def do_list_categories(mlist, k, subcat, outfp):
if info is None:
return
charset = Utils.GetCharSet(mlist.preferred_language)
- print >> outfp, '##', k.capitalize(), _('options')
+ print >> outfp, '##', k.capitalize(), C_('options')
print >> outfp, '#'
# First, massage the descripton text, which could have obnoxious
# leading whitespace on second and subsequent lines due to
@@ -199,7 +200,7 @@ def do_list_categories(mlist, k, subcat, outfp):
outfp.write('"""\n')
elif vtype in (mm_cfg.Radio, mm_cfg.Toggle):
print >> outfp, '#'
- print >> outfp, '#', _('legal values are:')
+ print >> outfp, '#', C_('legal values are:')
# TBD: This is disgusting, but it's special cased
# everywhere else anyway...
if varname == 'subscribe_policy' and \
@@ -253,7 +254,7 @@ def do_input(listname, infile, checkonly, verbose):
try:
mlist = MailList.MailList(listname, lock=not checkonly)
except Errors.MMListError, e:
- usage(1, _('No such list "%(listname)s"\n%(e)s'))
+ usage(1, C_('No such list "%(listname)s"\n%(e)s'))
savelist = 0
guibyprop = getPropertyMap(mlist)
try:
@@ -266,16 +267,16 @@ def do_input(listname, infile, checkonly, verbose):
if k in ('mlist', '__builtins__'):
continue
if not hasattr(mlist, k):
- print >> sys.stderr, _('attribute "%(k)s" ignored')
+ print >> sys.stderr, C_('attribute "%(k)s" ignored')
continue
if verbose:
- print >> sys.stderr, _('attribute "%(k)s" changed')
+ print >> sys.stderr, C_('attribute "%(k)s" changed')
missing = []
gui, wtype = guibyprop.get(k, (missing, missing))
if gui is missing:
# This isn't an official property of the list, but that's
# okay, we'll just restore it the old fashioned way
- print >> sys.stderr, _('Non-standard property restored: %(k)s')
+ print >> sys.stderr, C_('Non-standard property restored: %(k)s')
setattr(mlist, k, v)
else:
# BAW: This uses non-public methods. This logic taken from
@@ -283,9 +284,9 @@ def do_input(listname, infile, checkonly, verbose):
try:
validval = gui._getValidValue(mlist, k, wtype, v)
except ValueError:
- print >> sys.stderr, _('Invalid value for property: %(k)s')
+ print >> sys.stderr, C_('Invalid value for property: %(k)s')
except Errors.EmailAddressError:
- print >> sys.stderr, _(
+ print >> sys.stderr, C_(
'Bad email address for option %(k)s: %(v)s')
else:
# BAW: Horrible hack, but then this is special cased
@@ -342,13 +343,13 @@ def main():
# sanity check
if infile is not None and outfile is not None:
- usage(1, _('Only one of -i or -o is allowed'))
+ usage(1, C_('Only one of -i or -o is allowed'))
if infile is None and outfile is None:
- usage(1, _('One of -i or -o is required'))
+ usage(1, C_('One of -i or -o is required'))
# get the list name
if len(args) <> 1:
- usage(1, _('List name is required'))
+ usage(1, C_('List name is required'))
listname = args[0].lower().strip()
if outfile: