aboutsummaryrefslogtreecommitdiffstats
path: root/bin/add_members
diff options
context:
space:
mode:
Diffstat (limited to 'bin/add_members')
-rwxr-xr-xbin/add_members25
1 files changed, 15 insertions, 10 deletions
diff --git a/bin/add_members b/bin/add_members
index 13321935..bb1c0678 100755
--- a/bin/add_members
+++ b/bin/add_members
@@ -1,6 +1,6 @@
#! @PYTHON@
#
-# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -86,6 +86,7 @@ from Mailman import MailList
from Mailman import MemberAdaptor
_ = i18n._
+C_ = i18n.C_
@@ -94,7 +95,7 @@ def usage(status, msg=''):
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(status)
@@ -121,7 +122,7 @@ class Tee:
self.__outfp = outfp
def write(self, msg):
- sys.stdout.write(msg)
+ sys.stdout.write(i18n.tolocale(msg))
self.__outfp.write(msg)
@@ -137,7 +138,11 @@ def addall(mlist, members, digest, ack, outfp, nomail):
userdesc.digest = digest
try:
- mlist.ApprovedAddMember(userdesc, ack, 0)
+ mlist.ApprovedAddMember(userdesc,
+ ack=ack,
+ admin_notif=False,
+ whence='bin/add_members',
+ )
except Errors.MMAlreadyAMember:
print >> tee, _('Already a member: %(member)s')
except Errors.MembershipIsBanned, pattern:
@@ -192,14 +197,14 @@ def main():
elif arg.lower()[0] == 'n':
send_welcome_msg = 0
else:
- usage(1, _('Bad argument to -w/--welcome-msg: %(arg)s'))
+ usage(1, C_('Bad argument to -w/--welcome-msg: %(arg)s'))
elif opt in ('-a', '--admin-notify'):
if arg.lower()[0] == 'y':
admin_notif = 1
elif arg.lower()[0] == 'n':
admin_notif = 0
else:
- usage(1, _('Bad argument to -a/--admin-notify: %(arg)s'))
+ usage(1, C_('Bad argument to -a/--admin-notify: %(arg)s'))
elif opt in ('-n', '--nomail'):
nomail = True
@@ -207,13 +212,13 @@ def main():
usage(1)
if dfile == "-" and nfile == "-":
- usage(1, _('Cannot read both digest and normal members '
- 'from standard input.'))
+ usage(1, C_('Cannot read both digest and normal members '
+ 'from standard input.'))
try:
mlist = MailList.MailList(listname)
except Errors.MMUnknownListError:
- usage(1, _('No such list: %(listname)s'))
+ usage(1, C_('No such list: %(listname)s'))
# Set up defaults
if send_welcome_msg is None:
@@ -233,7 +238,7 @@ def main():
nmembers = readfile(nfile)
if not dmembers and not nmembers:
- usage(0, _('Nothing to do.'))
+ usage(0, C_('Nothing to do.'))
s = StringIO()
i18n.set_language(mlist.preferred_language)