aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-02-22 20:06:27 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-02-22 20:06:27 +0900
commite7519290ad288df840bc86d8dcaea524407df964 (patch)
tree6fe1349a50bfb9045e75b638c8ce0374fafa6d0d /bin
parent6aaafb6c05840389f1dd9139da9694f3b43c57df (diff)
downloadmailman2-e7519290ad288df840bc86d8dcaea524407df964.tar.gz
mailman2-e7519290ad288df840bc86d8dcaea524407df964.tar.xz
mailman2-e7519290ad288df840bc86d8dcaea524407df964.zip
* add option to pick up C_() texts to make potfile
* revise command line utils _()/C_() usage (not tested at all)
Diffstat (limited to 'bin')
-rw-r--r--bin/change_pw4
-rwxr-xr-xbin/check_perms2
-rwxr-xr-xbin/clone_member2
-rw-r--r--bin/export.py18
-rw-r--r--bin/fix_url.py2
-rw-r--r--bin/genaliases2
-rw-r--r--bin/reset_pw.py8
-rwxr-xr-xbin/sync_members2
-rwxr-xr-xbin/update4
9 files changed, 22 insertions, 22 deletions
diff --git a/bin/change_pw b/bin/change_pw
index 35be13d4..f3bb1977 100644
--- a/bin/change_pw
+++ b/bin/change_pw
@@ -142,11 +142,11 @@ def main():
if args:
strargs = SPACE.join(args)
- usage(1, _('Bad arguments: %(strargs)s'))
+ usage(1, C_('Bad arguments: %(strargs)s'))
if password is not None:
if not password:
- usage(1, _('Empty list passwords are not allowed'))
+ usage(1, C_('Empty list passwords are not allowed'))
shapassword = Utils.sha_new(password).hexdigest()
if domains:
diff --git a/bin/check_perms b/bin/check_perms
index 5249504a..9d552ea7 100755
--- a/bin/check_perms
+++ b/bin/check_perms
@@ -220,7 +220,7 @@ def checkarchives():
# In addition, on a multiuser system you may want to hide the private
# archives so other users can't read them.
if mode & S_IXOTH:
- print _("""\
+ print C_("""\
Warning: Private archive directory is other-executable (o+x).
This could allow other users on your system to read private archives.
If you're on a shared multiuser system, you should consult the
diff --git a/bin/clone_member b/bin/clone_member
index d9ff2247..b262aab5 100755
--- a/bin/clone_member
+++ b/bin/clone_member
@@ -133,7 +133,7 @@ def dolist(mlist, options):
pattern = mlist.GetBannedPattern(options.toaddr)
if pattern:
if not options.quiet:
- print ' ', _('Banned address (matched %(pattern)s)')
+ print ' ', C_('Banned address (matched %(pattern)s)')
return
# Now change the membership address
diff --git a/bin/export.py b/bin/export.py
index 63247df4..83ab1de1 100644
--- a/bin/export.py
+++ b/bin/export.py
@@ -35,7 +35,7 @@ from Mailman import MemberAdaptor
from Mailman import Utils
from Mailman import mm_cfg
from Mailman.MailList import MailList
-from Mailman.i18n import _
+from Mailman.i18n import C_
__i18n_templates__ = True
@@ -268,7 +268,7 @@ class XMLDumper(object):
try:
mlist = MailList(listname, lock=False)
except Errors.MMUnknownListError:
- print >> sys.stderr, _('No such list: %(listname)s')
+ print >> sys.stderr, C_('No such list: %(listname)s')
continue
self._dump_list(mlist, password_scheme)
self._pop_element('mailman')
@@ -316,39 +316,39 @@ else:
def parseargs():
parser = optparse.OptionParser(version=mm_cfg.VERSION,
- usage=_("""\
+ usage=C_("""\
%%prog [options]
Export the configuration and members of a mailing list in XML format."""))
parser.add_option('-o', '--outputfile',
metavar='FILENAME', default=None, type='string',
- help=_("""\
+ help=C_("""\
Output XML to FILENAME. If not given, or if FILENAME is '-', standard out is
used."""))
parser.add_option('-p', '--password-scheme',
- default='none', type='string', help=_("""\
+ default='none', type='string', help=C_("""\
Specify the RFC 2307 style hashing scheme for passwords included in the
output. Use -P to get a list of supported schemes, which are
case-insensitive."""))
parser.add_option('-P', '--list-hash-schemes',
- default=False, action='store_true', help=_("""\
+ default=False, action='store_true', help=C_("""\
List the supported password hashing schemes and exit. The scheme labels are
case-insensitive."""))
parser.add_option('-l', '--listname',
default=[], action='append', type='string',
- metavar='LISTNAME', dest='listnames', help=_("""\
+ metavar='LISTNAME', dest='listnames', help=C_("""\
The list to include in the output. If not given, then all mailing lists are
included in the XML output. Multiple -l flags may be given."""))
opts, args = parser.parse_args()
if args:
parser.print_help()
- parser.error(_('Unexpected arguments'))
+ parser.error(C_('Unexpected arguments'))
if opts.list_hash_schemes:
for label in SCHEMES:
print label.upper()
sys.exit(0)
if opts.password_scheme.lower() not in SCHEMES:
- parser.error(_('Invalid password scheme'))
+ parser.error(C_('Invalid password scheme'))
return parser, opts, args
diff --git a/bin/fix_url.py b/bin/fix_url.py
index 6523ce29..d4840beb 100644
--- a/bin/fix_url.py
+++ b/bin/fix_url.py
@@ -72,7 +72,7 @@ def fix_url(mlist, *args):
# Make sure list is locked.
if not mlist.Locked():
if verbose:
- print _('Locking list')
+ print C_('Locking list')
mlist.Lock()
if urlhost:
web_page_url = mm_cfg.DEFAULT_URL_PATTERN % urlhost
diff --git a/bin/genaliases b/bin/genaliases
index c49cba61..f9ff707a 100644
--- a/bin/genaliases
+++ b/bin/genaliases
@@ -81,7 +81,7 @@ def main():
if not mm_cfg.MTA:
mta = repr(mm_cfg.MTA)
- usage(2, _(
+ usage(2, C_(
"genaliases can't do anything useful with mm_cfg.MTA = %(mta)s."
))
diff --git a/bin/reset_pw.py b/bin/reset_pw.py
index e829aefe..b71d5323 100644
--- a/bin/reset_pw.py
+++ b/bin/reset_pw.py
@@ -38,7 +38,7 @@ import getopt
import paths
from Mailman import Utils
-from Mailman.i18n import _
+from Mailman.i18n import C_
try:
@@ -54,7 +54,7 @@ def usage(code, msg=''):
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__.replace('%', '%%'))
+ print >> fd, C_(__doc__.replace('%', '%%'))
if msg:
print >> fd, msg
sys.exit(code)
@@ -74,13 +74,13 @@ def reset_pw(mlist, *args):
listname = mlist.internal_name()
if verbose:
- print _('Changing passwords for list: %(listname)s')
+ print C_('Changing passwords for list: %(listname)s')
for member in mlist.getMembers():
randompw = Utils.MakeRandomPassword()
mlist.setMemberPassword(member, randompw)
if verbose:
- print _('New password for member %(member)40s: %(randompw)s')
+ print C_('New password for member %(member)40s: %(randompw)s')
mlist.Save()
diff --git a/bin/sync_members b/bin/sync_members
index 2ac73d2e..bb5eaa73 100755
--- a/bin/sync_members
+++ b/bin/sync_members
@@ -265,7 +265,7 @@ def main():
except Errors.MMAlreadyAMember:
pass
except Errors.MembershipIsBanned, pattern:
- print ('%s:' % addr), _('Banned address (matched %(pattern)s)')
+ print ('%s:' % addr), C_('Banned address (matched %(pattern)s)')
for laddr, addr in addrs.items():
# Should be a member, otherwise our test above is broken
diff --git a/bin/update b/bin/update
index 0ac5ffe8..b5843424 100755
--- a/bin/update
+++ b/bin/update
@@ -452,7 +452,7 @@ def update_qfiles():
except EnvironmentError, e:
if e.errno <> errno.ENOTDIR:
raise
- print _('Warning! Not a directory: %(dirpath)s')
+ print C_('Warning! Not a directory: %(dirpath)s')
@@ -541,7 +541,7 @@ def dequeue(filebase):
msg = data = None
except EOFError:
# For some reason the pckfile was empty. Just delete it.
- print _('Warning! Deleting empty .pck file: %(pckfile)s')
+ print C_('Warning! Deleting empty .pck file: %(pckfile)s')
os.unlink(pckfile)
finally:
if msgfp: