aboutsummaryrefslogtreecommitdiffstats
path: root/bin/sync_members
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/sync_members
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 '')
-rwxr-xr-xbin/sync_members34
1 files changed, 17 insertions, 17 deletions
diff --git a/bin/sync_members b/bin/sync_members
index 0c860d25..2ac73d2e 100755
--- a/bin/sync_members
+++ b/bin/sync_members
@@ -86,7 +86,7 @@ from Mailman import MailList
from Mailman import Errors
from Mailman import Utils
from Mailman.UserDesc import UserDesc
-from Mailman.i18n import _
+from Mailman.i18n import C_
@@ -97,7 +97,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)
@@ -112,7 +112,7 @@ def yesno(opt):
elif yesno in ('n', 'no'):
return 0
else:
- usage(1, _('Bad choice: %(yesno)s'))
+ usage(1, C_('Bad choice: %(yesno)s'))
# no return
@@ -135,7 +135,7 @@ def main():
elif opt in ('-n', '--no-change'):
dryrun = 1
i += 1
- print _('Dry run mode')
+ print C_('Dry run mode')
elif opt in ('-d', '--digest'):
digest = 1
i += 1
@@ -156,11 +156,11 @@ def main():
i += 1
elif opt in ('-f', '--file'):
if filename is not None:
- usage(1, _('Only one -f switch allowed'))
+ usage(1, C_('Only one -f switch allowed'))
try:
filename = sys.argv[i+1]
except IndexError:
- usage(1, _('No argument to -f given'))
+ usage(1, C_('No argument to -f given'))
i += 2
elif opt in ('-a', '--notifyadmin'):
notifyadmin = 1
@@ -169,17 +169,17 @@ def main():
notifyadmin = yesno(opt)
i += 1
elif opt[0] == '-':
- usage(1, _('Illegal option: %(opt)s'))
+ usage(1, C_('Illegal option: %(opt)s'))
else:
try:
listname = sys.argv[i].lower()
i += 1
except IndexError:
- usage(1, _('No listname given'))
+ usage(1, C_('No listname given'))
break
if listname is None or filename is None:
- usage(1, _('Must have a listname and a filename'))
+ usage(1, C_('Must have a listname and a filename'))
# read the list of addresses to sync to from the file
if filename == '-':
@@ -188,7 +188,7 @@ def main():
try:
fp = open(filename)
except IOError, (code, msg):
- usage(1, _('Cannot read address file: %(filename)s: %(msg)s'))
+ usage(1, C_('Cannot read address file: %(filename)s: %(msg)s'))
try:
filemembers = fp.readlines()
finally:
@@ -200,7 +200,7 @@ def main():
addr = filemembers[i].strip()
if addr == '' or addr[:1] == '#':
del filemembers[i]
- print _('Ignore : %(addr)30s')
+ print C_('Ignore : %(addr)30s')
# first filter out any invalid addresses
filemembers = email.Utils.getaddresses(filemembers)
@@ -209,17 +209,17 @@ def main():
try:
Utils.ValidateEmail(addr)
except Errors.EmailAddressError:
- print _('Invalid : %(addr)30s')
+ print C_('Invalid : %(addr)30s')
invalid = 1
if invalid:
- print _('You must fix the preceding invalid addresses first.')
+ print C_('You must fix the preceding invalid addresses first.')
sys.exit(1)
# get the locked list object
try:
mlist = MailList.MailList(listname)
except Errors.MMListError, e:
- print _('No such list: %(listname)s')
+ print C_('No such list: %(listname)s')
sys.exit(1)
try:
@@ -241,7 +241,7 @@ def main():
needsadding[laddr] = (name, addr)
if not needsadding and not addrs:
- print _('Nothing to do.')
+ print C_('Nothing to do.')
sys.exit(0)
enc = sys.getdefaultencoding()
@@ -261,7 +261,7 @@ def main():
name = unicode(name, errors='replace')
name = name.encode(enc, 'replace')
s = email.Utils.formataddr((name, addr)).encode(enc, 'replace')
- print _('Added : %(s)s')
+ print C_('Added : %(s)s')
except Errors.MMAlreadyAMember:
pass
except Errors.MembershipIsBanned, pattern:
@@ -285,7 +285,7 @@ def main():
name = unicode(name, errors='replace')
name = name.encode(enc, 'replace')
s = email.Utils.formataddr((name, addr)).encode(enc, 'replace')
- print _('Removed: %(s)s')
+ print C_('Removed: %(s)s')
mlist.Save()
finally: