Merge lp:~futatuki/mailman/2.1-commandline-locale into lp:mailman/2.1

Proposed by Yasuhito FUTATSUKI at POEM
Status: Merged
Merged at revision: 1625
Proposed branch: lp:~futatuki/mailman/2.1-commandline-locale
Merge into: lp:mailman/2.1
Diff against target: 2782 lines (+372/-345)
40 files modified
Mailman/MTA/Manual.py (+4/-4)
Mailman/MTA/Postfix.py (+9/-9)
Mailman/i18n.py (+25/-2)
bin/add_members (+9/-8)
bin/arch (+5/-5)
bin/b4b5-archfix (+2/-2)
bin/change_pw (+7/-6)
bin/check_db (+6/-6)
bin/check_perms (+42/-42)
bin/cleanarch (+5/-5)
bin/clone_member (+13/-13)
bin/config_list (+15/-14)
bin/convert.py (+3/-3)
bin/discard (+6/-6)
bin/dumpdb (+8/-8)
bin/export.py (+9/-9)
bin/find_member (+7/-7)
bin/fix_url.py (+6/-6)
bin/genaliases (+3/-3)
bin/inject (+5/-5)
bin/list_admins (+4/-4)
bin/list_lists (+5/-5)
bin/list_members (+10/-10)
bin/list_owners (+2/-2)
bin/mailmanctl (+18/-18)
bin/mmsitepass (+10/-10)
bin/newlist (+14/-13)
bin/qrunner (+5/-5)
bin/rb-archfix (+2/-2)
bin/remove_members (+6/-6)
bin/reset_pw.py (+4/-4)
bin/rmlist (+15/-15)
bin/show_qfiles (+2/-2)
bin/sync_members (+18/-18)
bin/transcheck (+2/-2)
bin/unshunt (+3/-3)
bin/update (+47/-47)
bin/version (+2/-2)
bin/withlist (+13/-13)
messages/Makefile.in (+1/-1)
To merge this branch: bzr merge lp:~futatuki/mailman/2.1-commandline-locale
Reviewer Review Type Date Requested Status
Mark Sapiro code Approve
Review via email: mp+287282@code.launchpad.net

Description of the change

This is a branch to fix bug #558167 .
With this changes, command line utilities show messages as LC_CTYPE and LC_MESSAGES specified,
if they have appropriate translation.

To post a comment you must log in.
Revision history for this message
Mark Sapiro (msapiro) wrote :

I have merged your branch with a few changes for conformance with <http://barry.warsaw.us/software/STYLEGUIDE.txt>.

Thanks to you for this and to Miloslav Trmac for the original patches.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Mailman/MTA/Manual.py'
2--- Mailman/MTA/Manual.py 2005-12-30 18:50:08 +0000
3+++ Mailman/MTA/Manual.py 2016-02-26 10:03:26 +0000
4@@ -25,7 +25,7 @@
5 from Mailman import Message
6 from Mailman import Utils
7 from Mailman.Queue.sbcache import get_switchboard
8-from Mailman.i18n import _
9+from Mailman.i18n import _, C_
10 from Mailman.MTA.Utils import makealiases
11
12 try:
13@@ -74,12 +74,12 @@
14 outfp = sfp
15 else:
16 if not quiet:
17- print _("""\
18+ print C_("""\
19 To finish creating your mailing list, you must edit your /etc/aliases (or
20 equivalent) file by adding the following lines, and possibly running the
21 `newaliases' program:
22 """)
23- print _("""\
24+ print C_("""\
25 ## %(listname)s mailing list""")
26 outfp = sys.stdout
27 # Common path
28@@ -120,7 +120,7 @@
29 """)
30 outfp = sfp
31 else:
32- print _("""
33+ print C_("""
34 To finish removing your mailing list, you must edit your /etc/aliases (or
35 equivalent) file by removing the following lines, and possibly running the
36 `newaliases' program:
37
38=== modified file 'Mailman/MTA/Postfix.py'
39--- Mailman/MTA/Postfix.py 2015-05-27 15:16:59 +0000
40+++ Mailman/MTA/Postfix.py 2016-02-26 10:03:26 +0000
41@@ -27,7 +27,7 @@
42 from Mailman import mm_cfg
43 from Mailman import Utils
44 from Mailman import LockFile
45-from Mailman.i18n import _
46+from Mailman.i18n import C_
47 from Mailman.MTA.Utils import makealiases
48 from Mailman.Logging.Syslog import syslog
49
50@@ -358,7 +358,7 @@
51 targetmode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
52 for file in ALIASFILE, VIRTFILE:
53 if state.VERBOSE:
54- print _('checking permissions on %(file)s')
55+ print C_('checking permissions on %(file)s')
56 stat = None
57 try:
58 stat = os.stat(file)
59@@ -368,9 +368,9 @@
60 if stat and (stat[ST_MODE] & targetmode) <> targetmode:
61 state.ERRORS += 1
62 octmode = oct(stat[ST_MODE])
63- print _('%(file)s permissions must be 066x (got %(octmode)s)'),
64+ print C_('%(file)s permissions must be 066x (got %(octmode)s)'),
65 if state.FIX:
66- print _('(fixing)')
67+ print C_('(fixing)')
68 os.chmod(file, stat[ST_MODE] | targetmode)
69 else:
70 print
71@@ -386,7 +386,7 @@
72 raise
73 continue
74 if state.VERBOSE:
75- print _('checking ownership of %(dbfile)s')
76+ print C_('checking ownership of %(dbfile)s')
77 user = mm_cfg.MAILMAN_USER
78 ownerok = stat[ST_UID] == pwd.getpwnam(user)[2]
79 if not ownerok:
80@@ -394,10 +394,10 @@
81 owner = pwd.getpwuid(stat[ST_UID])[0]
82 except KeyError:
83 owner = 'uid %d' % stat[ST_UID]
84- print _('%(dbfile)s owned by %(owner)s (must be owned by %(user)s'),
85+ print C_('%(dbfile)s owned by %(owner)s (must be owned by %(user)s'),
86 state.ERRORS += 1
87 if state.FIX:
88- print _('(fixing)')
89+ print C_('(fixing)')
90 uid = pwd.getpwnam(user)[2]
91 gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
92 os.chown(dbfile, uid, gid)
93@@ -406,9 +406,9 @@
94 if stat and (stat[ST_MODE] & targetmode) <> targetmode:
95 state.ERRORS += 1
96 octmode = oct(stat[ST_MODE])
97- print _('%(dbfile)s permissions must be 066x (got %(octmode)s)'),
98+ print C_('%(dbfile)s permissions must be 066x (got %(octmode)s)'),
99 if state.FIX:
100- print _('(fixing)')
101+ print C_('(fixing)')
102 os.chmod(dbfile, stat[ST_MODE] | targetmode)
103 else:
104 print
105
106=== modified file 'Mailman/i18n.py'
107--- Mailman/i18n.py 2010-09-07 22:25:24 +0000
108+++ Mailman/i18n.py 2016-02-26 10:03:26 +0000
109@@ -15,6 +15,7 @@
110 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
111 # USA.
112
113+import locale
114 import sys
115 import time
116 import gettext
117@@ -25,6 +26,15 @@
118
119 _translation = None
120
121+
122
123+def _get_ctype_charset():
124+ old = locale.setlocale(locale.LC_CTYPE, '')
125+ charset = locale.nl_langinfo(locale.CODESET)
126+ locale.setlocale(locale.LC_CTYPE, old)
127+ return charset
128+
129+_ctype_charset = _get_ctype_charset()
130+
131
132
133
134 def set_language(language=None):
135@@ -54,7 +64,7 @@
136
137
138
139
140-def _(s):
141+def _(s, frame = 1):
142 if s == '':
143 return s
144 assert s
145@@ -70,7 +80,7 @@
146 # original string is 1) locals dictionary, 2) globals dictionary.
147 #
148 # First, get the frame of the caller
149- frame = sys._getframe(1)
150+ frame = sys._getframe(frame)
151 # A `safe' dictionary is used so we won't get an exception if there's a
152 # missing key in the dictionary.
153 dict = SafeDict(frame.f_globals.copy())
154@@ -95,6 +105,19 @@
155
156
157
158
159+def tolocale(s):
160+ global _ctype_charset
161+ if isinstance(s, UnicodeType):
162+ return s
163+ source = _translation.charset ()
164+ if not source:
165+ return s
166+ return unicode(s, source, 'replace').encode(_ctype_charset, 'replace')
167+
168+def C_(s):
169+ return tolocale(_(s, 2))
170+
171+
172
173 def ctime(date):
174 # Don't make these module globals since we have to do runtime translation
175 # of the strings anyway.
176
177=== modified file 'bin/add_members'
178--- bin/add_members 2013-03-28 22:43:27 +0000
179+++ bin/add_members 2016-02-26 10:03:26 +0000
180@@ -86,6 +86,7 @@
181 from Mailman import MemberAdaptor
182
183 _ = i18n._
184+C_ = i18n.C_
185
186
187
188
189@@ -94,7 +95,7 @@
190 fd = sys.stderr
191 else:
192 fd = sys.stdout
193- print >> fd, _(__doc__)
194+ print >> fd, C_(__doc__)
195 if msg:
196 print >> fd, msg
197 sys.exit(status)
198@@ -121,7 +122,7 @@
199 self.__outfp = outfp
200
201 def write(self, msg):
202- sys.stdout.write(msg)
203+ sys.stdout.write(i18n.tolocale(msg))
204 self.__outfp.write(msg)
205
206
207@@ -196,14 +197,14 @@
208 elif arg.lower()[0] == 'n':
209 send_welcome_msg = 0
210 else:
211- usage(1, _('Bad argument to -w/--welcome-msg: %(arg)s'))
212+ usage(1, C_('Bad argument to -w/--welcome-msg: %(arg)s'))
213 elif opt in ('-a', '--admin-notify'):
214 if arg.lower()[0] == 'y':
215 admin_notif = 1
216 elif arg.lower()[0] == 'n':
217 admin_notif = 0
218 else:
219- usage(1, _('Bad argument to -a/--admin-notify: %(arg)s'))
220+ usage(1, C_('Bad argument to -a/--admin-notify: %(arg)s'))
221 elif opt in ('-n', '--nomail'):
222 nomail = True
223
224@@ -211,13 +212,13 @@
225 usage(1)
226
227 if dfile == "-" and nfile == "-":
228- usage(1, _('Cannot read both digest and normal members '
229- 'from standard input.'))
230+ usage(1, C_('Cannot read both digest and normal members '
231+ 'from standard input.'))
232
233 try:
234 mlist = MailList.MailList(listname)
235 except Errors.MMUnknownListError:
236- usage(1, _('No such list: %(listname)s'))
237+ usage(1, C_('No such list: %(listname)s'))
238
239 # Set up defaults
240 if send_welcome_msg is None:
241@@ -237,7 +238,7 @@
242 nmembers = readfile(nfile)
243
244 if not dmembers and not nmembers:
245- usage(0, _('Nothing to do.'))
246+ usage(0, C_('Nothing to do.'))
247
248 s = StringIO()
249 i18n.set_language(mlist.preferred_language)
250
251=== modified file 'bin/arch'
252--- bin/arch 2008-10-17 22:33:48 +0000
253+++ bin/arch 2016-02-26 10:03:26 +0000
254@@ -70,7 +70,7 @@
255 from Mailman.LockFile import LockFile
256 from Mailman import i18n
257
258-_ = i18n._
259+C_ = i18n.C_
260
261 PROGRAM = sys.argv[0]
262 i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
263@@ -82,7 +82,7 @@
264 fd = sys.stderr
265 else:
266 fd = sys.stdout
267- print >> fd, _(__doc__)
268+ print >> fd, C_(__doc__)
269 if msg:
270 print >> fd, msg
271 sys.exit(code)
272@@ -122,7 +122,7 @@
273
274 # grok arguments
275 if len(args) < 1:
276- usage(1, _('listname is required'))
277+ usage(1, C_('listname is required'))
278 listname = args[0].lower().strip()
279
280 if len(args) < 2:
281@@ -140,7 +140,7 @@
282 try:
283 mlist = MailList(listname)
284 except Errors.MMListError, e:
285- usage(2, _('No such list "%(listname)s"\n%(e)s'))
286+ usage(2, C_('No such list "%(listname)s"\n%(e)s'))
287 if mbox is None:
288 mbox = mlist.ArchiveFileName()
289
290@@ -165,7 +165,7 @@
291 try:
292 fp = open(mbox)
293 except IOError, msg:
294- usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s'))
295+ usage(3, C_('Cannot open mbox file %(mbox)s: %(msg)s'))
296 # Maybe wipe the old archives
297 if wipe:
298 if mlist.scrub_nondigest:
299
300=== modified file 'bin/b4b5-archfix'
301--- bin/b4b5-archfix 2005-08-27 01:40:17 +0000
302+++ bin/b4b5-archfix 2016-02-26 10:03:26 +0000
303@@ -44,7 +44,7 @@
304
305 # Required to get the right classes for unpickling
306 import paths
307-from Mailman.i18n import _
308+from Mailman.i18n import C_
309
310 PROGRAM = sys.argv[0]
311
312@@ -55,7 +55,7 @@
313 fd = sys.stderr
314 else:
315 fd = sys.stdout
316- print >> fd, _(__doc__)
317+ print >> fd, C_(__doc__)
318 if msg:
319 print >> fd, msg
320 sys.exit(code)
321
322=== modified file 'bin/change_pw'
323--- bin/change_pw 2008-11-13 04:02:29 +0000
324+++ bin/change_pw 2016-02-26 10:03:26 +0000
325@@ -77,6 +77,7 @@
326 from Mailman import i18n
327
328 _ = i18n._
329+C_ = i18n.C_
330
331 SPACE = ' '
332
333@@ -87,7 +88,7 @@
334 fd = sys.stderr
335 else:
336 fd = sys.stdout
337- print >> fd, _(__doc__)
338+ print >> fd, C_(__doc__)
339 if msg:
340 print >> fd, msg
341 sys.exit(code)
342@@ -103,7 +104,7 @@
343 try:
344 mlist = MailList.MailList(listname, lock=0)
345 except Errors.MMListError, e:
346- usage(1, _('No such list "%(listname)s"\n%(e)s'))
347+ usage(1, C_('No such list "%(listname)s"\n%(e)s'))
348 _listcache[listname] = mlist
349 return mlist
350
351@@ -141,11 +142,11 @@
352
353 if args:
354 strargs = SPACE.join(args)
355- usage(1, _('Bad arguments: %(strargs)s'))
356+ usage(1, C_('Bad arguments: %(strargs)s'))
357
358 if password is not None:
359 if not password:
360- usage(1, _('Empty list passwords are not allowed'))
361+ usage(1, C_('Empty list passwords are not allowed'))
362 shapassword = Utils.sha_new(password).hexdigest()
363
364 if domains:
365@@ -155,7 +156,7 @@
366 listnames[name] = 1
367
368 if not listnames:
369- print >> sys.stderr, _('Nothing to do.')
370+ print >> sys.stderr, C_('Nothing to do.')
371 sys.exit(0)
372
373 # Set the password on the lists
374@@ -177,7 +178,7 @@
375 mlist.Unlock()
376
377 # Notification
378- print _('New %(listname)s password: %(notifypassword)s')
379+ print C_('New %(listname)s password: %(notifypassword)s')
380 if not quiet:
381 otrans = i18n.get_translation()
382 i18n.set_language(mlist.preferred_language)
383
384=== modified file 'bin/check_db'
385--- bin/check_db 2005-08-27 01:40:17 +0000
386+++ bin/check_db 2016-02-26 10:03:26 +0000
387@@ -59,7 +59,7 @@
388 from Mailman import mm_cfg
389 from Mailman import Utils
390 from Mailman.MailList import MailList
391-from Mailman.i18n import _
392+from Mailman.i18n import C_
393
394 PROGRAM = sys.argv[0]
395
396@@ -70,7 +70,7 @@
397 fd = sys.stderr
398 else:
399 fd = sys.stdout
400- print >> fd, _(__doc__)
401+ print >> fd, C_(__doc__)
402 if msg:
403 print >> fd, msg
404 sys.exit(code)
405@@ -111,12 +111,12 @@
406
407 listnames = [n.lower().strip() for n in listnames]
408 if not listnames:
409- print _('Nothing to do.')
410+ print C_('Nothing to do.')
411 sys.exit(0)
412
413 for listname in listnames:
414 if not Utils.list_exists(listname):
415- print _('No list named:'), listname
416+ print C_('No list named:'), listname
417 continue
418 mlist = MailList(listname, lock=0)
419 pfile = os.path.join(mlist.fullpath(), 'config.pck')
420@@ -125,7 +125,7 @@
421 dlast = dfile + '.last'
422
423 if verbose:
424- print _('List:'), listname
425+ print C_('List:'), listname
426
427 for file in (pfile, plast, dfile, dlast):
428 status = 0
429@@ -145,7 +145,7 @@
430 else:
431 print ' %s: %s' % (file, status)
432 elif verbose:
433- print _(' %(file)s: okay')
434+ print C_(' %(file)s: okay')
435
436
437
438
439
440=== modified file 'bin/check_perms'
441--- bin/check_perms 2009-12-30 21:39:08 +0000
442+++ bin/check_perms 2016-02-26 10:03:26 +0000
443@@ -45,7 +45,7 @@
444 raise
445 from Mailman import mm_cfg
446 from Mailman.mm_cfg import MAILMAN_USER, MAILMAN_GROUP
447-from Mailman.i18n import _
448+from Mailman.i18n import C_
449
450 # Let KeyErrors percolate
451 MAILMAN_GID = grp.getgrnam(MAILMAN_GROUP)[2]
452@@ -107,7 +107,7 @@
453 for name in names:
454 path = os.path.join(dirname, name)
455 if arg.VERBOSE:
456- print _(' checking gid and mode for %(path)s')
457+ print C_(' checking gid and mode for %(path)s')
458 try:
459 mode, gid = statgidmode(path)
460 except OSError, e:
461@@ -119,10 +119,10 @@
462 except KeyError:
463 groupname = '<anon gid %d>' % gid
464 arg.ERRORS += 1
465- print _('%(path)s bad group (has: %(groupname)s, '
466- 'expected %(MAILMAN_GROUP)s)'),
467+ print C_('%(path)s bad group (has: %(groupname)s, '
468+ 'expected %(MAILMAN_GROUP)s)'),
469 if STATE.FIX:
470- print _('(fixing)')
471+ print C_('(fixing)')
472 os.chown(path, -1, MAILMAN_GID)
473 else:
474 print
475@@ -148,19 +148,19 @@
476 octperms = oct(targetperms)
477 if S_ISDIR(mode) and (mode & targetperms) <> targetperms:
478 arg.ERRORS += 1
479- print _('directory permissions must be %(octperms)s: %(path)s'),
480+ print C_('directory permissions must be %(octperms)s: %(path)s'),
481 if STATE.FIX:
482- print _('(fixing)')
483+ print C_('(fixing)')
484 os.chmod(path, mode | targetperms)
485 else:
486 print
487 elif os.path.splitext(path)[1] in ('.py', '.pyc', '.pyo'):
488 octperms = oct(PYFILEPERMS)
489 if mode & PYFILEPERMS <> PYFILEPERMS:
490- print _('source perms must be %(octperms)s: %(path)s'),
491+ print C_('source perms must be %(octperms)s: %(path)s'),
492 arg.ERRORS += 1
493 if STATE.FIX:
494- print _('(fixing)')
495+ print C_('(fixing)')
496 os.chmod(path, mode | PYFILEPERMS)
497 else:
498 print
499@@ -168,10 +168,10 @@
500 # Article files must be group writeable
501 octperms = oct(ARTICLEFILEPERMS)
502 if mode & ARTICLEFILEPERMS <> ARTICLEFILEPERMS:
503- print _('article db files must be %(octperms)s: %(path)s'),
504+ print C_('article db files must be %(octperms)s: %(path)s'),
505 arg.ERRORS += 1
506 if STATE.FIX:
507- print _('(fixing)')
508+ print C_('(fixing)')
509 os.chmod(path, mode | ARTICLEFILEPERMS)
510 else:
511 print
512@@ -180,7 +180,7 @@
513 # first check PREFIX
514 if STATE.VERBOSE:
515 prefix = mm_cfg.PREFIX
516- print _('checking mode for %(prefix)s')
517+ print C_('checking mode for %(prefix)s')
518 dirs = {}
519 for d in (mm_cfg.PREFIX, mm_cfg.EXEC_PREFIX, mm_cfg.VAR_PREFIX,
520 mm_cfg.LOG_DIR):
521@@ -190,13 +190,13 @@
522 mode = statmode(d)
523 except OSError, e:
524 if e.errno <> errno.ENOENT: raise
525- print _('WARNING: directory does not exist: %(d)s')
526+ print C_('WARNING: directory does not exist: %(d)s')
527 continue
528 if (mode & DIRPERMS) <> DIRPERMS:
529 STATE.ERRORS += 1
530- print _('directory must be at least 02775: %(d)s'),
531+ print C_('directory must be at least 02775: %(d)s'),
532 if STATE.FIX:
533- print _('(fixing)')
534+ print C_('(fixing)')
535 os.chmod(d, mode | DIRPERMS)
536 else:
537 print
538@@ -206,21 +206,21 @@
539 def checkarchives():
540 private = mm_cfg.PRIVATE_ARCHIVE_FILE_DIR
541 if STATE.VERBOSE:
542- print _('checking perms on %(private)s')
543+ print C_('checking perms on %(private)s')
544 # private archives must not be other readable
545 mode = statmode(private)
546 if mode & S_IROTH:
547 STATE.ERRORS += 1
548- print _('%(private)s must not be other-readable'),
549+ print C_('%(private)s must not be other-readable'),
550 if STATE.FIX:
551- print _('(fixing)')
552+ print C_('(fixing)')
553 os.chmod(private, mode & ~S_IROTH)
554 else:
555 print
556 # In addition, on a multiuser system you may want to hide the private
557 # archives so other users can't read them.
558 if mode & S_IXOTH:
559- print _("""\
560+ print C_("""\
561 Warning: Private archive directory is other-executable (o+x).
562 This could allow other users on your system to read private archives.
563 If you're on a shared multiuser system, you should consult the
564@@ -237,9 +237,9 @@
565 mode = statmode(mboxfile)
566 if (mode & MBOXPERMS) <> MBOXPERMS:
567 STATE.ERRORS = STATE.ERRORS + 1
568- print _('mbox file must be at least 0660:'), mboxfile
569+ print C_('mbox file must be at least 0660:'), mboxfile
570 if STATE.FIX:
571- print _('(fixing)')
572+ print C_('(fixing)')
573 os.chmod(mboxfile, mode | MBOXPERMS)
574 else:
575 print
576@@ -260,9 +260,9 @@
577 continue
578 if mode & S_IRWXO:
579 STATE.ERRORS += 1
580- print _('%(dbdir)s "other" perms must be 000'),
581+ print C_('%(dbdir)s "other" perms must be 000'),
582 if STATE.FIX:
583- print _('(fixing)')
584+ print C_('(fixing)')
585 os.chmod(dbdir, mode & ~S_IRWXO)
586 else:
587 print
588@@ -270,18 +270,18 @@
589 def checkcgi():
590 cgidir = os.path.join(mm_cfg.EXEC_PREFIX, 'cgi-bin')
591 if STATE.VERBOSE:
592- print _('checking cgi-bin permissions')
593+ print C_('checking cgi-bin permissions')
594 exes = os.listdir(cgidir)
595 for f in exes:
596 path = os.path.join(cgidir, f)
597 if STATE.VERBOSE:
598- print _(' checking set-gid for %(path)s')
599+ print C_(' checking set-gid for %(path)s')
600 mode = statmode(path)
601 if mode & S_IXGRP and not mode & S_ISGID:
602 STATE.ERRORS += 1
603- print _('%(path)s must be set-gid'),
604+ print C_('%(path)s must be set-gid'),
605 if STATE.FIX:
606- print _('(fixing)')
607+ print C_('(fixing)')
608 os.chmod(path, mode | S_ISGID)
609 else:
610 print
611@@ -289,13 +289,13 @@
612 def checkmail():
613 wrapper = os.path.join(mm_cfg.WRAPPER_DIR, 'mailman')
614 if STATE.VERBOSE:
615- print _('checking set-gid for %(wrapper)s')
616+ print C_('checking set-gid for %(wrapper)s')
617 mode = statmode(wrapper)
618 if not mode & S_ISGID:
619 STATE.ERRORS += 1
620- print _('%(wrapper)s must be set-gid'),
621+ print C_('%(wrapper)s must be set-gid'),
622 if STATE.FIX:
623- print _('(fixing)')
624+ print C_('(fixing)')
625 os.chmod(wrapper, mode | S_ISGID)
626
627 def checkadminpw():
628@@ -303,7 +303,7 @@
629 os.path.join(mm_cfg.DATA_DIR, 'creator.pw')):
630 targetmode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP
631 if STATE.VERBOSE:
632- print _('checking permissions on %(pwfile)s')
633+ print C_('checking permissions on %(pwfile)s')
634 try:
635 mode = statmode(pwfile)
636 except OSError, e:
637@@ -312,10 +312,10 @@
638 if mode <> targetmode:
639 STATE.ERRORS += 1
640 octmode = oct(mode)
641- print _('%(pwfile)s permissions must be exactly 0640 '
642- '(got %(octmode)s)'),
643+ print C_('%(pwfile)s permissions must be exactly 0640 '
644+ '(got %(octmode)s)'),
645 if STATE.FIX:
646- print _('(fixing)')
647+ print C_('(fixing)')
648 os.chmod(pwfile, targetmode)
649 else:
650 print
651@@ -337,7 +337,7 @@
652 'digest.mbox', 'pending.pck',
653 'request.db', 'request.db.tmp')
654 if STATE.VERBOSE:
655- print _('checking permissions on list data')
656+ print C_('checking permissions on list data')
657 # BAW: This needs to be converted to the Site module abstraction
658 for dir in os.listdir(mm_cfg.LIST_DATA_DIR):
659 if not os.path.isdir(os.path.join(mm_cfg.LIST_DATA_DIR, dir)):
660@@ -345,7 +345,7 @@
661 for file in checkfiles:
662 path = os.path.join(mm_cfg.LIST_DATA_DIR, dir, file)
663 if STATE.VERBOSE:
664- print _(' checking permissions on: %(path)s')
665+ print C_(' checking permissions on: %(path)s')
666 try:
667 mode = statmode(path)
668 except OSError, e:
669@@ -353,9 +353,9 @@
670 continue
671 if (mode & targetmode) <> targetmode:
672 STATE.ERRORS += 1
673- print _('file permissions must be at least 660: %(path)s'),
674+ print C_('file permissions must be at least 660: %(path)s'),
675 if STATE.FIX:
676- print _('(fixing)')
677+ print C_('(fixing)')
678 os.chmod(path, mode | targetmode)
679 else:
680 print
681@@ -367,7 +367,7 @@
682 fd = sys.stderr
683 else:
684 fd = sys.stdout
685- print >> fd, _(__doc__)
686+ print >> fd, C_(__doc__)
687 if msg:
688 print >> fd, msg
689 sys.exit(code)
690@@ -398,7 +398,7 @@
691 checkmta()
692
693 if not STATE.ERRORS:
694- print _('No problems found')
695+ print C_('No problems found')
696 else:
697- print _('Problems found:'), STATE.ERRORS
698- print _('Re-run as %(MAILMAN_USER)s (or root) with -f flag to fix')
699+ print C_('Problems found:'), STATE.ERRORS
700+ print C_('Re-run as %(MAILMAN_USER)s (or root) with -f flag to fix')
701
702=== modified file 'bin/cleanarch'
703--- bin/cleanarch 2006-01-22 20:34:20 +0000
704+++ bin/cleanarch 2016-02-26 10:03:26 +0000
705@@ -53,7 +53,7 @@
706 import mailbox
707
708 import paths
709-from Mailman.i18n import _
710+from Mailman.i18n import C_
711
712 cre = re.compile(mailbox.UnixMailbox._fromlinepattern)
713
714@@ -69,7 +69,7 @@
715 fd = sys.stderr
716 else:
717 fd = sys.stdout
718- print >> fd, _(__doc__)
719+ print >> fd, C_(__doc__)
720 if msg:
721 print >> fd, msg
722 sys.exit(code)
723@@ -80,7 +80,7 @@
724 if output:
725 sys.stdout.write('>' + line)
726 if not quiet:
727- print >> sys.stderr, _('Unix-From line changed: %(lineno)d')
728+ print >> sys.stderr, C_('Unix-From line changed: %(lineno)d')
729 print >> sys.stderr, line[:-1]
730
731
732@@ -108,7 +108,7 @@
733 try:
734 status = int(arg)
735 except ValueError:
736- usage(1, _('Bad status number: %(arg)s'))
737+ usage(1, C_('Bad status number: %(arg)s'))
738
739 if args:
740 usage(1)
741@@ -164,7 +164,7 @@
742 print >> sys.stderr
743 statuscnt = 0
744 prevline = line
745- print >> sys.stderr, _('%(messages)d messages found')
746+ print >> sys.stderr, C_('%(messages)d messages found')
747
748
749
750
751
752=== modified file 'bin/clone_member'
753--- bin/clone_member 2008-02-29 17:47:36 +0000
754+++ bin/clone_member 2016-02-26 10:03:26 +0000
755@@ -72,7 +72,7 @@
756 from Mailman import MailList
757 from Mailman import Utils
758 from Mailman import Errors
759-from Mailman.i18n import _
760+from Mailman.i18n import C_
761
762
763
764
765@@ -81,7 +81,7 @@
766 fd = sys.stderr
767 else:
768 fd = sys.stdout
769- print >> fd, _(__doc__)
770+ print >> fd, C_(__doc__)
771 if msg:
772 print >> fd, msg
773 sys.exit(code)
774@@ -91,14 +91,14 @@
775 def dolist(mlist, options):
776 SPACE = ' '
777 if not options.quiet:
778- print _('processing mailing list:'), mlist.internal_name()
779+ print C_('processing mailing list:'), mlist.internal_name()
780
781 # scan the list owners. TBD: mlist.owner keys should be lowercase?
782 oldowners = mlist.owner[:]
783 oldowners.sort()
784 if options.admintoo:
785 if not options.quiet:
786- print _(' scanning list owners:'), SPACE.join(oldowners)
787+ print C_(' scanning list owners:'), SPACE.join(oldowners)
788 newowners = {}
789 foundp = 0
790 for owner in mlist.owner:
791@@ -116,9 +116,9 @@
792 if not options.quiet:
793 if newowners <> oldowners:
794 print
795- print _(' new list owners:'), SPACE.join(newowners)
796+ print C_(' new list owners:'), SPACE.join(newowners)
797 else:
798- print _('(no change)')
799+ print C_('(no change)')
800
801 # see if the fromaddr is a digest member or regular member
802 if options.lfromaddr in mlist.getDigestMemberKeys():
803@@ -127,13 +127,13 @@
804 digest = 0
805 else:
806 if not options.quiet:
807- print _(' address not found:'), options.fromaddr
808+ print C_(' address not found:'), options.fromaddr
809 return
810 # Check for banned to address.
811 pattern = mlist.GetBannedPattern(options.toaddr)
812 if pattern:
813 if not options.quiet:
814- print ' ', _('Banned address (matched %(pattern)s)')
815+ print ' ', C_('Banned address (matched %(pattern)s)')
816 return
817
818 # Now change the membership address
819@@ -142,13 +142,13 @@
820 mlist.changeMemberAddress(options.fromaddr, options.toaddr,
821 not options.remove)
822 if not options.quiet:
823- print _(' clone address added:'), options.toaddr
824+ print C_(' clone address added:'), options.toaddr
825 except Errors.MMAlreadyAMember:
826 if not options.quiet:
827- print _(' clone address is already a member:'), options.toaddr
828+ print C_(' clone address is already a member:'), options.toaddr
829
830 if options.remove:
831- print _(' original address removed:'), options.fromaddr
832+ print C_(' original address removed:'), options.fromaddr
833
834
835
836
837@@ -199,7 +199,7 @@
838 try:
839 Utils.ValidateEmail(toaddr)
840 except Errors.EmailAddressError:
841- usage(1, _('Not a valid email address: %(toaddr)s'))
842+ usage(1, C_('Not a valid email address: %(toaddr)s'))
843 lfromaddr = fromaddr.lower()
844 options.toaddr = toaddr
845 options.fromaddr = fromaddr
846@@ -212,7 +212,7 @@
847 try:
848 mlist = MailList.MailList(listname)
849 except Errors.MMListError, e:
850- print _('Error opening list "%(listname)s", skipping.\n%(e)s')
851+ print C_('Error opening list "%(listname)s", skipping.\n%(e)s')
852 continue
853 try:
854 dolist(mlist, options)
855
856=== modified file 'bin/config_list'
857--- bin/config_list 2005-12-30 18:50:08 +0000
858+++ bin/config_list 2016-02-26 10:03:26 +0000
859@@ -76,6 +76,7 @@
860 from Mailman import i18n
861
862 _ = i18n._
863+C_ = i18n.C_
864
865 NL = '\n'
866 nonasciipat = re.compile(r'[\x80-\xff]')
867@@ -87,7 +88,7 @@
868 fd = sys.stderr
869 else:
870 fd = sys.stdout
871- print >> fd, _(__doc__)
872+ print >> fd, C_(__doc__)
873 if msg:
874 print >> fd, msg
875 sys.exit(code)
876@@ -106,7 +107,7 @@
877 try:
878 mlist = MailList.MailList(listname, lock=0)
879 except Errors.MMListError:
880- usage(1, _('No such list: %(listname)s'))
881+ usage(1, C_('No such list: %(listname)s'))
882 # Preamble for the config info. PEP263 charset and capture time.
883 language = mlist.preferred_language
884 charset = Utils.GetCharSet(language)
885@@ -114,7 +115,7 @@
886 if not charset:
887 charset = 'us-ascii'
888 when = time.ctime(time.time())
889- print >> outfp, _('''\
890+ print >> outfp, C_('''\
891 # -*- python -*-
892 # -*- coding: %(charset)s -*-
893 ## "%(listname)s" mailing list configuration settings
894@@ -140,7 +141,7 @@
895 if info is None:
896 return
897 charset = Utils.GetCharSet(mlist.preferred_language)
898- print >> outfp, '##', k.capitalize(), _('options')
899+ print >> outfp, '##', k.capitalize(), C_('options')
900 print >> outfp, '#'
901 # First, massage the descripton text, which could have obnoxious
902 # leading whitespace on second and subsequent lines due to
903@@ -199,7 +200,7 @@
904 outfp.write('"""\n')
905 elif vtype in (mm_cfg.Radio, mm_cfg.Toggle):
906 print >> outfp, '#'
907- print >> outfp, '#', _('legal values are:')
908+ print >> outfp, '#', C_('legal values are:')
909 # TBD: This is disgusting, but it's special cased
910 # everywhere else anyway...
911 if varname == 'subscribe_policy' and \
912@@ -253,7 +254,7 @@
913 try:
914 mlist = MailList.MailList(listname, lock=not checkonly)
915 except Errors.MMListError, e:
916- usage(1, _('No such list "%(listname)s"\n%(e)s'))
917+ usage(1, C_('No such list "%(listname)s"\n%(e)s'))
918 savelist = 0
919 guibyprop = getPropertyMap(mlist)
920 try:
921@@ -266,16 +267,16 @@
922 if k in ('mlist', '__builtins__'):
923 continue
924 if not hasattr(mlist, k):
925- print >> sys.stderr, _('attribute "%(k)s" ignored')
926+ print >> sys.stderr, C_('attribute "%(k)s" ignored')
927 continue
928 if verbose:
929- print >> sys.stderr, _('attribute "%(k)s" changed')
930+ print >> sys.stderr, C_('attribute "%(k)s" changed')
931 missing = []
932 gui, wtype = guibyprop.get(k, (missing, missing))
933 if gui is missing:
934 # This isn't an official property of the list, but that's
935 # okay, we'll just restore it the old fashioned way
936- print >> sys.stderr, _('Non-standard property restored: %(k)s')
937+ print >> sys.stderr, C_('Non-standard property restored: %(k)s')
938 setattr(mlist, k, v)
939 else:
940 # BAW: This uses non-public methods. This logic taken from
941@@ -283,9 +284,9 @@
942 try:
943 validval = gui._getValidValue(mlist, k, wtype, v)
944 except ValueError:
945- print >> sys.stderr, _('Invalid value for property: %(k)s')
946+ print >> sys.stderr, C_('Invalid value for property: %(k)s')
947 except Errors.EmailAddressError:
948- print >> sys.stderr, _(
949+ print >> sys.stderr, C_(
950 'Bad email address for option %(k)s: %(v)s')
951 else:
952 # BAW: Horrible hack, but then this is special cased
953@@ -342,13 +343,13 @@
954
955 # sanity check
956 if infile is not None and outfile is not None:
957- usage(1, _('Only one of -i or -o is allowed'))
958+ usage(1, C_('Only one of -i or -o is allowed'))
959 if infile is None and outfile is None:
960- usage(1, _('One of -i or -o is required'))
961+ usage(1, C_('One of -i or -o is required'))
962
963 # get the list name
964 if len(args) <> 1:
965- usage(1, _('List name is required'))
966+ usage(1, C_('List name is required'))
967 listname = args[0].lower().strip()
968
969 if outfile:
970
971=== modified file 'bin/convert.py'
972--- bin/convert.py 2005-08-27 01:40:17 +0000
973+++ bin/convert.py 2016-02-26 10:03:26 +0000
974@@ -25,7 +25,7 @@
975
976 import paths
977 from Mailman import Utils
978-from Mailman.i18n import _
979+from Mailman.i18n import C_
980
981 def convert(mlist):
982 for attr in ('msg_header', 'msg_footer', 'digest_header', 'digest_footer',
983@@ -35,10 +35,10 @@
984 t = Utils.to_dollar(s)
985 setattr(mlist, attr, t)
986 mlist.use_dollar_strings = 1
987- print _('Saving list')
988+ print C_('Saving list')
989 mlist.Save()
990
991
992
993
994 if __name__ == '__main__':
995- print _(__doc__.replace('%', '%%'))
996+ print C_(__doc__.replace('%', '%%'))
997
998=== modified file 'bin/discard'
999--- bin/discard 2005-08-27 01:40:17 +0000
1000+++ bin/discard 2016-02-26 10:03:26 +0000
1001@@ -41,7 +41,7 @@
1002 import paths
1003 from Mailman import mm_cfg
1004 from Mailman.MailList import MailList
1005-from Mailman.i18n import _
1006+from Mailman.i18n import C_
1007
1008 try:
1009 True, False
1010@@ -58,7 +58,7 @@
1011 fd = sys.stderr
1012 else:
1013 fd = sys.stdout
1014- print >> fd, _(__doc__)
1015+ print >> fd, C_(__doc__)
1016 if msg:
1017 print >> fd, msg
1018 sys.exit(code)
1019@@ -80,7 +80,7 @@
1020
1021 files = args
1022 if not files:
1023- print _('Nothing to do.')
1024+ print C_('Nothing to do.')
1025
1026 # Mapping from listnames to sequence of request ids
1027 discards = {}
1028@@ -91,13 +91,13 @@
1029 basename = os.path.basename(f)
1030 mo = cre.match(basename)
1031 if not mo:
1032- print >> sys.stderr, _('Ignoring non-held message: %(f)s')
1033+ print >> sys.stderr, C_('Ignoring non-held message: %(f)s')
1034 continue
1035 listname, id = mo.group('listname', 'id')
1036 try:
1037 id = int(id)
1038 except (ValueError, TypeError):
1039- print >> sys.stderr, _('Ignoring held msg w/bad id: %(f)s')
1040+ print >> sys.stderr, C_('Ignoring held msg w/bad id: %(f)s')
1041 continue
1042 discards.setdefault(listname, []).append(id)
1043
1044@@ -109,7 +109,7 @@
1045 # No comment, no preserve, no forward, no forwarding address
1046 mlist.HandleRequest(id, mm_cfg.DISCARD, '', False, False, '')
1047 if not quiet:
1048- print _('Discarded held msg #%(id)s for list %(listname)s')
1049+ print C_('Discarded held msg #%(id)s for list %(listname)s')
1050 mlist.Save()
1051 finally:
1052 mlist.Unlock()
1053
1054=== modified file 'bin/dumpdb'
1055--- bin/dumpdb 2007-08-04 01:16:56 +0000
1056+++ bin/dumpdb 2016-02-26 10:03:26 +0000
1057@@ -54,7 +54,7 @@
1058
1059 import paths
1060 # Import this /after/ paths so that the sys.path is properly hacked
1061-from Mailman.i18n import _
1062+from Mailman.i18n import C_
1063
1064 PROGRAM = sys.argv[0]
1065 COMMASPACE = ', '
1066@@ -72,7 +72,7 @@
1067 fd = sys.stderr
1068 else:
1069 fd = sys.stdout
1070- print >> fd, _(__doc__) % globals()
1071+ print >> fd, C_(__doc__) % globals()
1072 if msg:
1073 print >> fd, msg
1074 sys.exit(code)
1075@@ -102,10 +102,10 @@
1076 doprint = False
1077
1078 if len(args) < 1:
1079- usage(1, _('No filename given.'))
1080+ usage(1, C_('No filename given.'))
1081 elif len(args) > 1:
1082 pargs = COMMASPACE.join(args)
1083- usage(1, _('Bad arguments: %(pargs)s'))
1084+ usage(1, C_('Bad arguments: %(pargs)s'))
1085 else:
1086 filename = args[0]
1087
1088@@ -115,7 +115,7 @@
1089 elif filename.endswith('.pck'):
1090 filetype = 0
1091 else:
1092- usage(1, _('Please specify either -p or -m.'))
1093+ usage(1, C_('Please specify either -p or -m.'))
1094
1095 # Handle dbs
1096 pp = pprint.PrettyPrinter(indent=4)
1097@@ -130,16 +130,16 @@
1098 try:
1099 cnt = 1
1100 if doprint:
1101- print _('[----- start %(typename)s file -----]')
1102+ print C_('[----- start %(typename)s file -----]')
1103 while True:
1104 try:
1105 obj = load(fp)
1106 except EOFError:
1107 if doprint:
1108- print _('[----- end %(typename)s file -----]')
1109+ print C_('[----- end %(typename)s file -----]')
1110 break
1111 if doprint:
1112- print _('<----- start object %(cnt)s ----->')
1113+ print C_('<----- start object %(cnt)s ----->')
1114 if isinstance(obj, StringType):
1115 print obj
1116 else:
1117
1118=== modified file 'bin/export.py'
1119--- bin/export.py 2011-08-24 16:45:30 +0000
1120+++ bin/export.py 2016-02-26 10:03:26 +0000
1121@@ -35,7 +35,7 @@
1122 from Mailman import Utils
1123 from Mailman import mm_cfg
1124 from Mailman.MailList import MailList
1125-from Mailman.i18n import _
1126+from Mailman.i18n import C_
1127
1128 __i18n_templates__ = True
1129
1130@@ -268,7 +268,7 @@
1131 try:
1132 mlist = MailList(listname, lock=False)
1133 except Errors.MMUnknownListError:
1134- print >> sys.stderr, _('No such list: %(listname)s')
1135+ print >> sys.stderr, C_('No such list: %(listname)s')
1136 continue
1137 self._dump_list(mlist, password_scheme)
1138 self._pop_element('mailman')
1139@@ -316,39 +316,39 @@
1140
1141
1142 def parseargs():
1143 parser = optparse.OptionParser(version=mm_cfg.VERSION,
1144- usage=_("""\
1145+ usage=C_("""\
1146 %%prog [options]
1147
1148 Export the configuration and members of a mailing list in XML format."""))
1149 parser.add_option('-o', '--outputfile',
1150 metavar='FILENAME', default=None, type='string',
1151- help=_("""\
1152+ help=C_("""\
1153 Output XML to FILENAME. If not given, or if FILENAME is '-', standard out is
1154 used."""))
1155 parser.add_option('-p', '--password-scheme',
1156- default='none', type='string', help=_("""\
1157+ default='none', type='string', help=C_("""\
1158 Specify the RFC 2307 style hashing scheme for passwords included in the
1159 output. Use -P to get a list of supported schemes, which are
1160 case-insensitive."""))
1161 parser.add_option('-P', '--list-hash-schemes',
1162- default=False, action='store_true', help=_("""\
1163+ default=False, action='store_true', help=C_("""\
1164 List the supported password hashing schemes and exit. The scheme labels are
1165 case-insensitive."""))
1166 parser.add_option('-l', '--listname',
1167 default=[], action='append', type='string',
1168- metavar='LISTNAME', dest='listnames', help=_("""\
1169+ metavar='LISTNAME', dest='listnames', help=C_("""\
1170 The list to include in the output. If not given, then all mailing lists are
1171 included in the XML output. Multiple -l flags may be given."""))
1172 opts, args = parser.parse_args()
1173 if args:
1174 parser.print_help()
1175- parser.error(_('Unexpected arguments'))
1176+ parser.error(C_('Unexpected arguments'))
1177 if opts.list_hash_schemes:
1178 for label in SCHEMES:
1179 print label.upper()
1180 sys.exit(0)
1181 if opts.password_scheme.lower() not in SCHEMES:
1182- parser.error(_('Invalid password scheme'))
1183+ parser.error(C_('Invalid password scheme'))
1184 return parser, opts, args
1185
1186
1187
1188=== modified file 'bin/find_member'
1189--- bin/find_member 2009-01-11 16:06:13 +0000
1190+++ bin/find_member 2016-02-26 10:03:26 +0000
1191@@ -64,7 +64,7 @@
1192 from Mailman import Utils
1193 from Mailman import MailList
1194 from Mailman import Errors
1195-from Mailman.i18n import _
1196+from Mailman.i18n import C_
1197
1198 AS_MEMBER = 0x01
1199 AS_OWNER = 0x02
1200@@ -76,7 +76,7 @@
1201 fd = sys.stderr
1202 else:
1203 fd = sys.stdout
1204- print >> fd, _(__doc__)
1205+ print >> fd, C_(__doc__)
1206 if msg:
1207 print >> fd, msg
1208 sys.exit(code)
1209@@ -94,7 +94,7 @@
1210 try:
1211 mlist = MailList.MailList(listname, lock=0)
1212 except Errors.MMListError:
1213- print _('No such list: %(listname)s')
1214+ print C_('No such list: %(listname)s')
1215 continue
1216 if options.owners:
1217 owners = mlist.owner
1218@@ -156,12 +156,12 @@
1219 pass
1220
1221 if not args:
1222- usage(1, _('Search regular expression required'))
1223+ usage(1, C_('Search regular expression required'))
1224
1225 options.regexps = args
1226
1227 if not options.listnames:
1228- print _('No lists to search')
1229+ print C_('No lists to search')
1230 return
1231
1232 matches = scanlists(options)
1233@@ -170,13 +170,13 @@
1234 for k in addrs:
1235 hits = matches[k]
1236 lists = hits.keys()
1237- print k, _('found in:')
1238+ print k, C_('found in:')
1239 for name in lists:
1240 aswhat = hits[name]
1241 if aswhat & AS_MEMBER:
1242 print ' ', name
1243 if aswhat & AS_OWNER:
1244- print ' ', name, _('(as owner)')
1245+ print ' ', name, C_('(as owner)')
1246
1247
1248
1249
1250
1251=== modified file 'bin/fix_url.py'
1252--- bin/fix_url.py 2010-07-27 14:41:37 +0000
1253+++ bin/fix_url.py 2016-02-26 10:03:26 +0000
1254@@ -43,12 +43,12 @@
1255
1256 import paths
1257 from Mailman import mm_cfg
1258-from Mailman.i18n import _
1259+from Mailman.i18n import C_
1260
1261
1262
1263
1264 def usage(code, msg=''):
1265- print _(__doc__.replace('%', '%%'))
1266+ print C_(__doc__.replace('%', '%%'))
1267 if msg:
1268 print msg
1269 sys.exit(code)
1270@@ -72,7 +72,7 @@
1271 # Make sure list is locked.
1272 if not mlist.Locked():
1273 if verbose:
1274- print _('Locking list')
1275+ print C_('Locking list')
1276 mlist.Lock()
1277 if urlhost:
1278 web_page_url = mm_cfg.DEFAULT_URL_PATTERN % urlhost
1279@@ -82,12 +82,12 @@
1280 mailhost = mm_cfg.DEFAULT_EMAIL_HOST
1281
1282 if verbose:
1283- print _('Setting web_page_url to: %(web_page_url)s')
1284+ print C_('Setting web_page_url to: %(web_page_url)s')
1285 mlist.web_page_url = web_page_url
1286 if verbose:
1287- print _('Setting host_name to: %(mailhost)s')
1288+ print C_('Setting host_name to: %(mailhost)s')
1289 mlist.host_name = mailhost
1290- print _('Saving list')
1291+ print C_('Saving list')
1292 mlist.Save()
1293 mlist.Unlock()
1294
1295
1296=== modified file 'bin/genaliases'
1297--- bin/genaliases 2011-04-16 16:40:26 +0000
1298+++ bin/genaliases 2016-02-26 10:03:26 +0000
1299@@ -40,7 +40,7 @@
1300 from Mailman import mm_cfg
1301 from Mailman import Utils
1302 from Mailman import MailList
1303-from Mailman.i18n import _
1304+from Mailman.i18n import C_
1305
1306 try:
1307 True, False
1308@@ -55,7 +55,7 @@
1309 fd = sys.stderr
1310 else:
1311 fd = sys.stdout
1312- print >> fd, _(__doc__)
1313+ print >> fd, C_(__doc__)
1314 if msg:
1315 print >> fd, msg
1316 sys.exit(code)
1317@@ -81,7 +81,7 @@
1318
1319 if not mm_cfg.MTA:
1320 mta = repr(mm_cfg.MTA)
1321- usage(2, _(
1322+ usage(2, C_(
1323 "genaliases can't do anything useful with mm_cfg.MTA = %(mta)s."
1324 ))
1325
1326
1327=== modified file 'bin/inject'
1328--- bin/inject 2007-12-04 19:42:54 +0000
1329+++ bin/inject 2016-02-26 10:03:26 +0000
1330@@ -48,7 +48,7 @@
1331 from Mailman import mm_cfg
1332 from Mailman import Utils
1333 from Mailman import Post
1334-from Mailman.i18n import _
1335+from Mailman.i18n import C_
1336
1337
1338
1339
1340@@ -57,7 +57,7 @@
1341 fd = sys.stderr
1342 else:
1343 fd = sys.stdout
1344- print >> fd, _(__doc__)
1345+ print >> fd, C_(__doc__)
1346 if msg:
1347 print >> fd, msg
1348 sys.exit(code)
1349@@ -81,14 +81,14 @@
1350 elif opt in ('-q', '--queue'):
1351 qdir = os.path.join(mm_cfg.QUEUE_DIR, arg)
1352 if not os.path.isdir(qdir):
1353- usage(1, _('Bad queue directory: %(qdir)s'))
1354+ usage(1, C_('Bad queue directory: %(qdir)s'))
1355 elif opt in ('-l', '--listname'):
1356 listname = arg.lower()
1357
1358 if listname is None:
1359- usage(1, _('A list name is required'))
1360+ usage(1, C_('A list name is required'))
1361 elif not Utils.list_exists(listname):
1362- usage(1, _('No such list: %(listname)s'))
1363+ usage(1, C_('No such list: %(listname)s'))
1364
1365 if len(args) == 0:
1366 # Use standard input
1367
1368=== modified file 'bin/list_admins'
1369--- bin/list_admins 2007-12-04 19:42:54 +0000
1370+++ bin/list_admins 2016-02-26 10:03:26 +0000
1371@@ -45,7 +45,7 @@
1372 import paths
1373 from Mailman import MailList, Utils
1374 from Mailman import Errors
1375-from Mailman.i18n import _
1376+from Mailman.i18n import C_
1377
1378 COMMASPACE = ', '
1379
1380@@ -58,7 +58,7 @@
1381 fd = sys.stderr
1382 else:
1383 fd = sys.stdout
1384- print >> fd, _(__doc__)
1385+ print >> fd, C_(__doc__)
1386 if msg:
1387 print >> fd, msg
1388 sys.exit(code)
1389@@ -87,14 +87,14 @@
1390 try:
1391 mlist = MailList.MailList(listname, lock=0)
1392 except Errors.MMListError, e:
1393- print _('No such list: %(listname)s')
1394+ print C_('No such list: %(listname)s')
1395 continue
1396
1397 if vhost and vhost <> mlist.host_name:
1398 continue
1399
1400 owners = COMMASPACE.join(mlist.owner)
1401- print _('List: %(listname)s, \tOwners: %(owners)s')
1402+ print C_('List: %(listname)s, \tOwners: %(owners)s')
1403
1404
1405
1406
1407
1408=== modified file 'bin/list_lists'
1409--- bin/list_lists 2012-11-24 20:16:55 +0000
1410+++ bin/list_lists 2016-02-26 10:03:26 +0000
1411@@ -50,7 +50,7 @@
1412 from Mailman import MailList
1413 from Mailman import Utils
1414 from Mailman import Errors
1415-from Mailman.i18n import _
1416+from Mailman.i18n import C_
1417
1418 program = sys.argv[0]
1419
1420@@ -59,7 +59,7 @@
1421 fd = sys.stderr
1422 else:
1423 fd = sys.stdout
1424- print >> fd, _(__doc__)
1425+ print >> fd, C_(__doc__)
1426 if msg:
1427 print >> fd, msg
1428 sys.exit(code)
1429@@ -110,18 +110,18 @@
1430 longest = max(len(mlist.real_name), longest)
1431
1432 if not mlists and not bare:
1433- print _('No matching mailing lists found')
1434+ print C_('No matching mailing lists found')
1435 return
1436
1437 if not bare:
1438- print len(mlists), _('matching mailing lists found:')
1439+ print len(mlists), C_('matching mailing lists found:')
1440
1441 format = '%%%ds - %%.%ds' % (longest, 77 - longest)
1442 for mlist in mlists:
1443 if bare:
1444 print mlist.internal_name()
1445 else:
1446- description = mlist.description or _('[no description available]')
1447+ description = mlist.description or C_('[no description available]')
1448 print ' ', format % (mlist.real_name, description)
1449
1450
1451
1452=== modified file 'bin/list_members'
1453--- bin/list_members 2016-01-18 04:44:26 +0000
1454+++ bin/list_members 2016-02-26 10:03:26 +0000
1455@@ -81,7 +81,7 @@
1456 from Mailman import MailList
1457 from Mailman import Errors
1458 from Mailman import MemberAdaptor
1459-from Mailman.i18n import _
1460+from Mailman.i18n import C_
1461
1462 from email.Utils import formataddr
1463
1464@@ -109,7 +109,7 @@
1465 fd = sys.stderr
1466 else:
1467 fd = sys.stdout
1468- print >> fd, _(__doc__)
1469+ print >> fd, C_(__doc__)
1470 if msg:
1471 print >> fd, msg
1472 sys.exit(code)
1473@@ -195,7 +195,7 @@
1474 if i >= 0:
1475 why = opt[i+1:]
1476 if why not in WHYCHOICES.keys():
1477- usage(1, _('Bad --nomail option: %(why)s'))
1478+ usage(1, C_('Bad --nomail option: %(why)s'))
1479 elif opt == '-d':
1480 digest = True
1481 if args and args[0] in ('mime', 'plain'):
1482@@ -206,23 +206,23 @@
1483 if i >= 0:
1484 kind = opt[i+1:]
1485 if kind not in ('mime', 'plain'):
1486- usage(1, _('Bad --digest option: %(kind)s'))
1487+ usage(1, C_('Bad --digest option: %(kind)s'))
1488 elif opt in ('-m', '--moderated'):
1489 moderatedonly = True
1490 if nonmoderatedonly or invalidonly or unicodeonly:
1491- usage(1, _('Only one of -m, -M, -i or -u may be specified.'))
1492+ usage(1, C_('Only one of -m, -M, -i or -u may be specified.'))
1493 elif opt in ('-M', '--non-moderated'):
1494 nonmoderatedonly = True
1495 if moderatedonly or invalidonly or unicodeonly:
1496- usage(1, _('Only one of -m, -M, -i or -u may be specified.'))
1497+ usage(1, C_('Only one of -m, -M, -i or -u may be specified.'))
1498 elif opt in ('-i', '--invalid'):
1499 invalidonly = True
1500 if moderatedonly or nonmoderatedonly or unicodeonly:
1501- usage(1, _('Only one of -m, -M, -i or -u may be specified.'))
1502+ usage(1, C_('Only one of -m, -M, -i or -u may be specified.'))
1503 elif opt in ('-u', '--unicode'):
1504 unicodeonly = True
1505 if moderatedonly or nonmoderatedonly or invalidonly:
1506- usage(1, _('Only one of -m, -M, -i or -u may be specified.'))
1507+ usage(1, C_('Only one of -m, -M, -i or -u may be specified.'))
1508 else:
1509 # No more options left, push the last one back on the list
1510 args.insert(0, opt)
1511@@ -240,7 +240,7 @@
1512 try:
1513 fp = open(outfile, 'w')
1514 except IOError:
1515- print >> sys.stderr, _('Could not open file for writing:'), outfile
1516+ print >> sys.stderr, C_('Could not open file for writing:'), outfile
1517 sys.exit(1)
1518 else:
1519 fp = sys.stdout
1520@@ -248,7 +248,7 @@
1521 try:
1522 mlist = MailList.MailList(listname, lock=False)
1523 except Errors.MMListError, e:
1524- print >> sys.stderr, _('No such list: %(listname)s')
1525+ print >> sys.stderr, C_('No such list: %(listname)s')
1526 sys.exit(1)
1527
1528 # Get the lowercased member addresses
1529
1530=== modified file 'bin/list_owners'
1531--- bin/list_owners 2007-12-04 19:42:54 +0000
1532+++ bin/list_owners 2016-02-26 10:03:26 +0000
1533@@ -45,7 +45,7 @@
1534 import paths
1535 from Mailman import Utils
1536 from Mailman.MailList import MailList
1537-from Mailman.i18n import _
1538+from Mailman.i18n import C_
1539
1540 PROGRAM = sys.argv[0]
1541
1542@@ -62,7 +62,7 @@
1543 fd = sys.stderr
1544 else:
1545 fd = sys.stdout
1546- print >> fd, _(__doc__)
1547+ print >> fd, C_(__doc__)
1548 if msg:
1549 print >> fd, msg
1550 sys.exit(code)
1551
1552=== modified file 'bin/mailmanctl'
1553--- bin/mailmanctl 2015-09-02 00:10:17 +0000
1554+++ bin/mailmanctl 2016-02-26 10:03:26 +0000
1555@@ -108,7 +108,7 @@
1556 from Mailman import LockFile
1557 from Mailman import Errors
1558 from Mailman.MailList import MailList
1559-from Mailman.i18n import _
1560+from Mailman.i18n import C_
1561 from Mailman.Logging.Syslog import syslog
1562 from Mailman.Logging.Utils import LogStdErr
1563
1564@@ -133,7 +133,7 @@
1565 fd = sys.stderr
1566 else:
1567 fd = sys.stdout
1568- print >> fd, _(__doc__)
1569+ print >> fd, C_(__doc__)
1570 if msg:
1571 print >> fd, msg
1572 sys.exit(code)
1573@@ -149,17 +149,17 @@
1574 except (IOError, ValueError), e:
1575 # For i18n convenience
1576 pidfile = mm_cfg.PIDFILE
1577- print >> sys.stderr, _('PID unreadable in: %(pidfile)s')
1578+ print >> sys.stderr, C_('PID unreadable in: %(pidfile)s')
1579 print >> sys.stderr, e
1580- print >> sys.stderr, _('Is qrunner even running?')
1581+ print >> sys.stderr, C_('Is qrunner even running?')
1582 return
1583 try:
1584 os.kill(pid, sig)
1585 except OSError, e:
1586 if e.errno <> errno.ESRCH: raise
1587- print >> sys.stderr, _('No child with pid: %(pid)s')
1588+ print >> sys.stderr, C_('No child with pid: %(pid)s')
1589 print >> sys.stderr, e
1590- print >> sys.stderr, _('Stale pid file removed.')
1591+ print >> sys.stderr, C_('Stale pid file removed.')
1592 os.unlink(mm_cfg.PIDFILE)
1593
1594
1595@@ -218,19 +218,19 @@
1596 status = qrunner_state()
1597 if status == 1:
1598 # host matches and proc exists
1599- print >> sys.stderr, _("""\
1600+ print >> sys.stderr, C_("""\
1601 The master qrunner lock could not be acquired because it appears as if another
1602 master qrunner is already running.
1603 """)
1604 elif status == 0:
1605 # host matches but no proc
1606- print >> sys.stderr, _("""\
1607+ print >> sys.stderr, C_("""\
1608 The master qrunner lock could not be acquired. It appears as though there is
1609 a stale master qrunner lock. Try re-running mailmanctl with the -s flag.
1610 """)
1611 else:
1612 # host doesn't even match
1613- print >> sys.stderr, _("""\
1614+ print >> sys.stderr, C_("""\
1615 The master qrunner lock could not be acquired, because it appears as if some
1616 process on some other host may have acquired it. We can't test for stale
1617 locks across host boundaries, so you'll have to do this manually. Or, if you
1618@@ -277,7 +277,7 @@
1619 try:
1620 sitelist = MailList(sitelistname, lock=0)
1621 except Errors.MMUnknownListError:
1622- print >> sys.stderr, _('Site list is missing: %(sitelistname)s')
1623+ print >> sys.stderr, C_('Site list is missing: %(sitelistname)s')
1624 syslog('error', 'Site list is missing: %s', mm_cfg.MAILMAN_SITE_LIST)
1625 sys.exit(1)
1626
1627@@ -302,7 +302,7 @@
1628 os.setuid(uid)
1629 elif myuid <> uid:
1630 name = mm_cfg.MAILMAN_USER
1631- usage(1, _(
1632+ usage(1, C_(
1633 'Run this program as root or as the %(name)s user, or use -u.'))
1634
1635
1636@@ -333,15 +333,15 @@
1637 quiet = 1
1638
1639 if len(args) < 1:
1640- usage(1, _('No command given.'))
1641+ usage(1, C_('No command given.'))
1642 elif len(args) > 1:
1643 command = COMMASPACE.join(args)
1644- usage(1, _('Bad command: %(command)s'))
1645+ usage(1, C_('Bad command: %(command)s'))
1646
1647 if checkprivs:
1648 check_privs()
1649 else:
1650- print _('Warning! You may encounter permission problems.')
1651+ print C_('Warning! You may encounter permission problems.')
1652
1653 # Handle the commands
1654 command = args[0].lower()
1655@@ -350,18 +350,18 @@
1656 # giving cron/qrunner a ctrl-c or KeyboardInterrupt. This will
1657 # effectively shut everything down.
1658 if not quiet:
1659- print _("Shutting down Mailman's master qrunner")
1660+ print C_("Shutting down Mailman's master qrunner")
1661 kill_watcher(signal.SIGTERM)
1662 elif command == 'restart':
1663 # Sent the master qrunner process a SIGHUP. This will cause the
1664 # master qrunner to kill and restart all the worker qrunners, and to
1665 # close and re-open its log files.
1666 if not quiet:
1667- print _("Restarting Mailman's master qrunner")
1668+ print C_("Restarting Mailman's master qrunner")
1669 kill_watcher(signal.SIGINT)
1670 elif command == 'reopen':
1671 if not quiet:
1672- print _('Re-opening all log files')
1673+ print C_('Re-opening all log files')
1674 kill_watcher(signal.SIGHUP)
1675 elif command == 'start':
1676 # First, complain loudly if there's no site list.
1677@@ -397,7 +397,7 @@
1678 if pid:
1679 # parent
1680 if not quiet:
1681- print _("Starting Mailman's master qrunner.")
1682+ print C_("Starting Mailman's master qrunner.")
1683 # Give up the lock "ownership". This just means the foreground
1684 # process won't close/unlock the lock when it finalizes this lock
1685 # instance. We'll let the mater watcher subproc own the lock.
1686
1687=== modified file 'bin/mmsitepass'
1688--- bin/mmsitepass 2005-08-27 01:40:17 +0000
1689+++ bin/mmsitepass 2016-02-26 10:03:26 +0000
1690@@ -43,7 +43,7 @@
1691
1692 import paths
1693 from Mailman import Utils
1694-from Mailman.i18n import _
1695+from Mailman.i18n import C_
1696
1697 PROGRAM = sys.argv[0]
1698
1699@@ -54,7 +54,7 @@
1700 fd = sys.stderr
1701 else:
1702 fd = sys.stdout
1703- print >> fd, _(__doc__)
1704+ print >> fd, C_(__doc__)
1705 if msg:
1706 print >> fd, msg
1707 sys.exit(code)
1708@@ -70,34 +70,34 @@
1709
1710 # Defaults
1711 siteadmin = 1
1712- pwdesc = _('site')
1713+ pwdesc = C_('site')
1714
1715 for opt, arg in opts:
1716 if opt in ('-h', '--help'):
1717 usage(0)
1718 elif opt in ('-c', '--listcreator'):
1719 siteadmin = 0
1720- pwdesc = _('list creator')
1721+ pwdesc = C_('list creator')
1722
1723 if len(args) == 1:
1724 pw1 = args[0]
1725 else:
1726 try:
1727- pw1 = getpass.getpass(_('New %(pwdesc)s password: '))
1728- pw2 = getpass.getpass(_('Again to confirm password: '))
1729+ pw1 = getpass.getpass(C_('New %(pwdesc)s password: '))
1730+ pw2 = getpass.getpass(C_('Again to confirm password: '))
1731 if pw1 <> pw2:
1732- print _('Passwords do not match; no changes made.')
1733+ print C_('Passwords do not match; no changes made.')
1734 sys.exit(1)
1735 except KeyboardInterrupt:
1736- print _('Interrupted...')
1737+ print C_('Interrupted...')
1738 sys.exit(0)
1739 # Set the site password by writing it to a local file. Make sure the
1740 # permissions don't allow other+read.
1741 Utils.set_global_password(pw1, siteadmin)
1742 if Utils.check_global_password(pw1, siteadmin):
1743- print _('Password changed.')
1744+ print C_('Password changed.')
1745 else:
1746- print _('Password change failed.')
1747+ print C_('Password change failed.')
1748
1749
1750
1751
1752
1753=== modified file 'bin/newlist'
1754--- bin/newlist 2015-01-23 00:09:03 +0000
1755+++ bin/newlist 2016-02-26 10:03:26 +0000
1756@@ -112,6 +112,7 @@
1757 from Mailman import i18n
1758
1759 _ = i18n._
1760+C_ = i18n.C_
1761
1762 PROGRAM = sys.argv[0]
1763
1764@@ -122,7 +123,7 @@
1765 fd = sys.stderr
1766 else:
1767 fd = sys.stdout
1768- print >> fd, _(__doc__)
1769+ print >> fd, C_(__doc__)
1770 if msg:
1771 print >> fd, msg
1772 sys.exit(code)
1773@@ -158,12 +159,12 @@
1774
1775 # Is the language known?
1776 if lang not in mm_cfg.LC_DESCRIPTIONS.keys():
1777- usage(1, _('Unknown language: %(lang)s'))
1778+ usage(1, C_('Unknown language: %(lang)s'))
1779
1780 if len(args) > 0:
1781 listname = args[0]
1782 else:
1783- listname = raw_input(_('Enter the name of the list: '))
1784+ listname = raw_input(C_('Enter the name of the list: '))
1785 listname = listname.lower()
1786
1787 if '@' in listname:
1788@@ -178,22 +179,22 @@
1789 web_page_url = mm_cfg.DEFAULT_URL_PATTERN % urlhost
1790
1791 if Utils.list_exists(listname):
1792- usage(1, _('List already exists: %(listname)s'))
1793+ usage(1, C_('List already exists: %(listname)s'))
1794
1795 if len(args) > 1:
1796 owner_mail = args[1]
1797 else:
1798 owner_mail = raw_input(
1799- _('Enter the email of the person running the list: '))
1800+ C_('Enter the email of the person running the list: '))
1801
1802 if len(args) > 2:
1803 listpasswd = args[2]
1804 else:
1805- listpasswd = getpass.getpass(_('Initial %(listname)s password: '))
1806+ listpasswd = getpass.getpass(C_('Initial %(listname)s password: '))
1807 # List passwords cannot be empty
1808 listpasswd = listpasswd.strip()
1809 if not listpasswd:
1810- usage(1, _('The list password cannot be empty'))
1811+ usage(1, C_('The list password cannot be empty'))
1812
1813 mlist = MailList.MailList()
1814 try:
1815@@ -213,13 +214,13 @@
1816 finally:
1817 os.umask(oldmask)
1818 except Errors.BadListNameError, s:
1819- usage(1, _('Illegal list name: %(s)s'))
1820+ usage(1, C_('Illegal list name: %(s)s'))
1821 except Errors.EmailAddressError, s:
1822- usage(1, _('Bad owner email address: %(s)s') +
1823- _(' - owner addresses need to be fully-qualified names'
1824- ' like "owner@example.com", not just "owner".'))
1825+ usage(1, C_('Bad owner email address: %(s)s') +
1826+ C_(' - owner addresses need to be fully-qualified names'
1827+ ' like "owner@example.com", not just "owner".'))
1828 except Errors.MMListAlreadyExistsError:
1829- usage(1, _('List already exists: %(listname)s'))
1830+ usage(1, C_('List already exists: %(listname)s'))
1831
1832 # Assign domain-specific attributes
1833 mlist.host_name = host_name
1834@@ -240,7 +241,7 @@
1835
1836 # And send the notice to the list owner
1837 if not quiet and not automate:
1838- print _('Hit enter to notify %(listname)s owner...'),
1839+ print C_('Hit enter to notify %(listname)s owner...'),
1840 sys.stdin.readline()
1841 if not quiet:
1842 siteowner = Utils.get_site_email(mlist.host_name, 'owner')
1843
1844=== modified file 'bin/qrunner'
1845--- bin/qrunner 2006-01-19 01:07:40 +0000
1846+++ bin/qrunner 2016-02-26 10:03:26 +0000
1847@@ -78,7 +78,7 @@
1848
1849 import paths
1850 from Mailman import mm_cfg
1851-from Mailman.i18n import _
1852+from Mailman.i18n import C_
1853 from Mailman.Logging.Syslog import syslog
1854 from Mailman.Logging.Utils import LogStdErr
1855
1856@@ -95,7 +95,7 @@
1857 fd = sys.stderr
1858 else:
1859 fd = sys.stdout
1860- print >> fd, _(__doc__)
1861+ print >> fd, C_(__doc__)
1862 if msg:
1863 print >> fd, msg
1864 sys.exit(code)
1865@@ -175,8 +175,8 @@
1866 name = runnername[:-len('Runner')]
1867 else:
1868 name = runnername
1869- print _('%(name)s runs the %(runnername)s qrunner')
1870- print _('All runs all the above qrunners')
1871+ print C_('%(name)s runs the %(runnername)s qrunner')
1872+ print C_('All runs all the above qrunners')
1873 sys.exit(0)
1874 elif opt in ('-o', '--once'):
1875 once = 1
1876@@ -212,7 +212,7 @@
1877 if len(args) <> 0:
1878 usage(1)
1879 if len(runners) == 0:
1880- usage(1, _('No runner name given.'))
1881+ usage(1, C_('No runner name given.'))
1882
1883 # Before we startup qrunners, we redirect the stderr to mailman syslog.
1884 # We assume !AS_SUBPROC is running for debugging purpose and don't
1885
1886=== modified file 'bin/rb-archfix'
1887--- bin/rb-archfix 2005-08-27 01:40:17 +0000
1888+++ bin/rb-archfix 2016-02-26 10:03:26 +0000
1889@@ -52,7 +52,7 @@
1890
1891 # Required to get the right classes for unpickling
1892 import paths
1893-from Mailman.i18n import _
1894+from Mailman.i18n import C_
1895
1896 PROGRAM = sys.argv[0]
1897
1898@@ -63,7 +63,7 @@
1899 fd = sys.stderr
1900 else:
1901 fd = sys.stdout
1902- print >> fd, _(__doc__)
1903+ print >> fd, C_(__doc__)
1904 if msg:
1905 print >> fd, msg
1906 sys.exit(code)
1907
1908=== modified file 'bin/remove_members'
1909--- bin/remove_members 2005-12-30 18:50:08 +0000
1910+++ bin/remove_members 2016-02-26 10:03:26 +0000
1911@@ -66,7 +66,7 @@
1912 from Mailman import MailList
1913 from Mailman import Utils
1914 from Mailman import Errors
1915-from Mailman.i18n import _
1916+from Mailman.i18n import C_
1917
1918 try:
1919 True, False
1920@@ -81,7 +81,7 @@
1921 fd = sys.stderr
1922 else:
1923 fd = sys.stdout
1924- print >> fd, _(__doc__)
1925+ print >> fd, C_(__doc__)
1926 if msg:
1927 print >> fd, msg
1928 sys.exit(code)
1929@@ -153,14 +153,14 @@
1930 try:
1931 addresses = addresses + ReadFile(filename)
1932 except IOError:
1933- print _('Could not open file for reading: %(filename)s.')
1934+ print C_('Could not open file for reading: %(filename)s.')
1935
1936 for listname in listnames:
1937 try:
1938 # open locked
1939 mlist = MailList.MailList(listname)
1940 except Errors.MMListError:
1941- print _('Error opening list %(listname)s... skipping.')
1942+ print C_('Error opening list %(listname)s... skipping.')
1943 continue
1944
1945 if all:
1946@@ -170,12 +170,12 @@
1947 for addr in addresses:
1948 if not mlist.isMember(addr):
1949 if not alllists:
1950- print _('No such member: %(addr)s')
1951+ print C_('No such member: %(addr)s')
1952 continue
1953 mlist.ApprovedDeleteMember(addr, 'bin/remove_members',
1954 admin_notif, userack)
1955 if alllists:
1956- print _("User `%(addr)s' removed from list: %(listname)s.")
1957+ print C_("User `%(addr)s' removed from list: %(listname)s.")
1958 mlist.Save()
1959 finally:
1960 mlist.Unlock()
1961
1962=== modified file 'bin/reset_pw.py'
1963--- bin/reset_pw.py 2005-08-27 01:40:17 +0000
1964+++ bin/reset_pw.py 2016-02-26 10:03:26 +0000
1965@@ -38,7 +38,7 @@
1966
1967 import paths
1968 from Mailman import Utils
1969-from Mailman.i18n import _
1970+from Mailman.i18n import C_
1971
1972
1973 try:
1974@@ -54,7 +54,7 @@
1975 fd = sys.stderr
1976 else:
1977 fd = sys.stdout
1978- print >> fd, _(__doc__.replace('%', '%%'))
1979+ print >> fd, C_(__doc__.replace('%', '%%'))
1980 if msg:
1981 print >> fd, msg
1982 sys.exit(code)
1983@@ -74,13 +74,13 @@
1984
1985 listname = mlist.internal_name()
1986 if verbose:
1987- print _('Changing passwords for list: %(listname)s')
1988+ print C_('Changing passwords for list: %(listname)s')
1989
1990 for member in mlist.getMembers():
1991 randompw = Utils.MakeRandomPassword()
1992 mlist.setMemberPassword(member, randompw)
1993 if verbose:
1994- print _('New password for member %(member)40s: %(randompw)s')
1995+ print C_('New password for member %(member)40s: %(randompw)s')
1996
1997 mlist.Save()
1998
1999
2000=== modified file 'bin/rmlist'
2001--- bin/rmlist 2015-01-27 02:30:02 +0000
2002+++ bin/rmlist 2016-02-26 10:03:26 +0000
2003@@ -46,7 +46,7 @@
2004 from Mailman import mm_cfg
2005 from Mailman import Utils
2006 from Mailman import MailList
2007-from Mailman.i18n import _
2008+from Mailman.i18n import C_
2009
2010 try:
2011 True, False
2012@@ -61,7 +61,7 @@
2013 fd = sys.stderr
2014 else:
2015 fd = sys.stdout
2016- print >> fd, _(__doc__)
2017+ print >> fd, C_(__doc__)
2018 if msg:
2019 print >> fd, msg
2020 sys.exit(code)
2021@@ -70,15 +70,15 @@
2022
2023
2024 def remove_it(listname, filename, msg):
2025 if os.path.islink(filename):
2026- print _('Removing %(msg)s')
2027+ print C_('Removing %(msg)s')
2028 os.unlink(filename)
2029 elif os.path.isdir(filename):
2030- print _('Removing %(msg)s')
2031+ print C_('Removing %(msg)s')
2032 shutil.rmtree(filename)
2033 elif os.path.isfile(filename):
2034 os.unlink(filename)
2035 else:
2036- print _('%(listname)s %(msg)s not found as %(filename)s')
2037+ print C_('%(listname)s %(msg)s not found as %(filename)s')
2038
2039
2040
2041
2042@@ -102,13 +102,13 @@
2043
2044 if not Utils.list_exists(listname):
2045 if not removeArchives:
2046- usage(1, _('No such list (or list already deleted): %(listname)s'))
2047+ usage(1, C_('No such list (or list already deleted): %(listname)s'))
2048 else:
2049- print _(
2050+ print C_(
2051 'No such list: %(listname)s. Removing its residual archives.')
2052
2053 if not removeArchives:
2054- print _('Not removing archives. Reinvoke with -a to remove them.')
2055+ print C_('Not removing archives. Reinvoke with -a to remove them.')
2056
2057
2058 REMOVABLES = []
2059@@ -122,7 +122,7 @@
2060 sys.modules[modname].remove(mlist)
2061
2062 REMOVABLES = [
2063- (os.path.join(mm_cfg.LIST_DATA_DIR, listname), _('list info')),
2064+ (os.path.join(mm_cfg.LIST_DATA_DIR, listname), C_('list info')),
2065 ]
2066
2067 # Remove any stale locks associated with the list
2068@@ -130,7 +130,7 @@
2069 fn_listname = filename.split('.')[0]
2070 if fn_listname == listname:
2071 REMOVABLES.append((os.path.join(mm_cfg.LOCK_DIR, filename),
2072- _('stale lock file')))
2073+ C_('stale lock file')))
2074
2075 # Remove any held messages for this list
2076 for filename in os.listdir(mm_cfg.DATA_DIR):
2077@@ -138,18 +138,18 @@
2078 re.IGNORECASE)
2079 if cre.match(filename):
2080 REMOVABLES.append((os.path.join(mm_cfg.DATA_DIR, filename),
2081- _('held message file')))
2082+ C_('held message file')))
2083
2084 if removeArchives:
2085 REMOVABLES.extend([
2086 (os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, listname),
2087- _('private archives')),
2088+ C_('private archives')),
2089 (os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, listname + '.mbox'),
2090- _('private archives')),
2091+ C_('private archives')),
2092 (os.path.join(mm_cfg.PUBLIC_ARCHIVE_FILE_DIR, listname),
2093- _('public archives')),
2094+ C_('public archives')),
2095 (os.path.join(mm_cfg.PUBLIC_ARCHIVE_FILE_DIR, listname + '.mbox'),
2096- _('public archives')),
2097+ C_('public archives')),
2098 ])
2099
2100 for dir, msg in REMOVABLES:
2101
2102=== modified file 'bin/show_qfiles'
2103--- bin/show_qfiles 2006-03-09 22:13:48 +0000
2104+++ bin/show_qfiles 2016-02-26 10:03:26 +0000
2105@@ -37,7 +37,7 @@
2106 from cPickle import load
2107
2108 import paths
2109-from Mailman.i18n import _
2110+from Mailman.i18n import C_
2111
2112 try:
2113 True, False
2114@@ -52,7 +52,7 @@
2115 fd = sys.stderr
2116 else:
2117 fd = sys.stdout
2118- print >> fd, _(__doc__)
2119+ print >> fd, C_(__doc__)
2120 if msg:
2121 print >> fd, msg
2122 sys.exit(code)
2123
2124=== modified file 'bin/sync_members'
2125--- bin/sync_members 2013-12-01 21:22:52 +0000
2126+++ bin/sync_members 2016-02-26 10:03:26 +0000
2127@@ -86,7 +86,7 @@
2128 from Mailman import Errors
2129 from Mailman import Utils
2130 from Mailman.UserDesc import UserDesc
2131-from Mailman.i18n import _
2132+from Mailman.i18n import C_
2133
2134
2135
2136
2137@@ -97,7 +97,7 @@
2138 fd = sys.stderr
2139 else:
2140 fd = sys.stdout
2141- print >> fd, _(__doc__)
2142+ print >> fd, C_(__doc__)
2143 if msg:
2144 print >> fd, msg
2145 sys.exit(code)
2146@@ -112,7 +112,7 @@
2147 elif yesno in ('n', 'no'):
2148 return 0
2149 else:
2150- usage(1, _('Bad choice: %(yesno)s'))
2151+ usage(1, C_('Bad choice: %(yesno)s'))
2152 # no return
2153
2154
2155@@ -135,7 +135,7 @@
2156 elif opt in ('-n', '--no-change'):
2157 dryrun = 1
2158 i += 1
2159- print _('Dry run mode')
2160+ print C_('Dry run mode')
2161 elif opt in ('-d', '--digest'):
2162 digest = 1
2163 i += 1
2164@@ -156,11 +156,11 @@
2165 i += 1
2166 elif opt in ('-f', '--file'):
2167 if filename is not None:
2168- usage(1, _('Only one -f switch allowed'))
2169+ usage(1, C_('Only one -f switch allowed'))
2170 try:
2171 filename = sys.argv[i+1]
2172 except IndexError:
2173- usage(1, _('No argument to -f given'))
2174+ usage(1, C_('No argument to -f given'))
2175 i += 2
2176 elif opt in ('-a', '--notifyadmin'):
2177 notifyadmin = 1
2178@@ -169,17 +169,17 @@
2179 notifyadmin = yesno(opt)
2180 i += 1
2181 elif opt[0] == '-':
2182- usage(1, _('Illegal option: %(opt)s'))
2183+ usage(1, C_('Illegal option: %(opt)s'))
2184 else:
2185 try:
2186 listname = sys.argv[i].lower()
2187 i += 1
2188 except IndexError:
2189- usage(1, _('No listname given'))
2190+ usage(1, C_('No listname given'))
2191 break
2192
2193 if listname is None or filename is None:
2194- usage(1, _('Must have a listname and a filename'))
2195+ usage(1, C_('Must have a listname and a filename'))
2196
2197 # read the list of addresses to sync to from the file
2198 if filename == '-':
2199@@ -188,7 +188,7 @@
2200 try:
2201 fp = open(filename)
2202 except IOError, (code, msg):
2203- usage(1, _('Cannot read address file: %(filename)s: %(msg)s'))
2204+ usage(1, C_('Cannot read address file: %(filename)s: %(msg)s'))
2205 try:
2206 filemembers = fp.readlines()
2207 finally:
2208@@ -200,7 +200,7 @@
2209 addr = filemembers[i].strip()
2210 if addr == '' or addr[:1] == '#':
2211 del filemembers[i]
2212- print _('Ignore : %(addr)30s')
2213+ print C_('Ignore : %(addr)30s')
2214
2215 # first filter out any invalid addresses
2216 filemembers = email.Utils.getaddresses(filemembers)
2217@@ -209,17 +209,17 @@
2218 try:
2219 Utils.ValidateEmail(addr)
2220 except Errors.EmailAddressError:
2221- print _('Invalid : %(addr)30s')
2222+ print C_('Invalid : %(addr)30s')
2223 invalid = 1
2224 if invalid:
2225- print _('You must fix the preceding invalid addresses first.')
2226+ print C_('You must fix the preceding invalid addresses first.')
2227 sys.exit(1)
2228
2229 # get the locked list object
2230 try:
2231 mlist = MailList.MailList(listname)
2232 except Errors.MMListError, e:
2233- print _('No such list: %(listname)s')
2234+ print C_('No such list: %(listname)s')
2235 sys.exit(1)
2236
2237 try:
2238@@ -241,7 +241,7 @@
2239 needsadding[laddr] = (name, addr)
2240
2241 if not needsadding and not addrs:
2242- print _('Nothing to do.')
2243+ print C_('Nothing to do.')
2244 sys.exit(0)
2245
2246 enc = sys.getdefaultencoding()
2247@@ -261,11 +261,11 @@
2248 name = unicode(name, errors='replace')
2249 name = name.encode(enc, 'replace')
2250 s = email.Utils.formataddr((name, addr)).encode(enc, 'replace')
2251- print _('Added : %(s)s')
2252+ print C_('Added : %(s)s')
2253 except Errors.MMAlreadyAMember:
2254 pass
2255 except Errors.MembershipIsBanned, pattern:
2256- print ('%s:' % addr), _('Banned address (matched %(pattern)s)')
2257+ print ('%s:' % addr), C_('Banned address (matched %(pattern)s)')
2258
2259 for laddr, addr in addrs.items():
2260 # Should be a member, otherwise our test above is broken
2261@@ -285,7 +285,7 @@
2262 name = unicode(name, errors='replace')
2263 name = name.encode(enc, 'replace')
2264 s = email.Utils.formataddr((name, addr)).encode(enc, 'replace')
2265- print _('Removed: %(s)s')
2266+ print C_('Removed: %(s)s')
2267
2268 mlist.Save()
2269 finally:
2270
2271=== modified file 'bin/transcheck'
2272--- bin/transcheck 2007-12-07 05:16:42 +0000
2273+++ bin/transcheck 2016-02-26 10:03:26 +0000
2274@@ -36,7 +36,7 @@
2275 import getopt
2276
2277 import paths
2278-from Mailman.i18n import _
2279+from Mailman.i18n import C_
2280
2281 program = sys.argv[0]
2282
2283@@ -47,7 +47,7 @@
2284 fd = sys.stderr
2285 else:
2286 fd = sys.stdout
2287- print >> fd, _(__doc__)
2288+ print >> fd, C_(__doc__)
2289 if msg:
2290 print >> fd, msg
2291 sys.exit(code)
2292
2293=== modified file 'bin/unshunt'
2294--- bin/unshunt 2007-11-18 20:43:31 +0000
2295+++ bin/unshunt 2016-02-26 10:03:26 +0000
2296@@ -38,7 +38,7 @@
2297 import paths
2298 from Mailman import mm_cfg
2299 from Mailman.Queue.sbcache import get_switchboard
2300-from Mailman.i18n import _
2301+from Mailman.i18n import C_
2302
2303
2304
2305
2306@@ -47,7 +47,7 @@
2307 fd = sys.stderr
2308 else:
2309 fd = sys.stdout
2310- print >> fd, _(__doc__)
2311+ print >> fd, C_(__doc__)
2312 if msg:
2313 print >> fd, msg
2314 sys.exit(code)
2315@@ -82,7 +82,7 @@
2316 except Exception, e:
2317 # If there are any unshunting errors, log them and continue trying
2318 # other shunted messages.
2319- print >> sys.stderr, _(
2320+ print >> sys.stderr, C_(
2321 'Cannot unshunt message %(filebase)s, skipping:\n%(e)s')
2322 else:
2323 # Unlink the .bak file left by dequeue()
2324
2325=== modified file 'bin/update'
2326--- bin/update 2009-07-31 22:37:29 +0000
2327+++ bin/update 2016-02-26 10:03:26 +0000
2328@@ -52,7 +52,7 @@
2329 from Mailman import Message
2330 from Mailman import Pending
2331 from Mailman.LockFile import TimeOutError
2332-from Mailman.i18n import _
2333+from Mailman.i18n import C_
2334 from Mailman.Queue.Switchboard import Switchboard
2335 from Mailman.OldStyleMemberships import OldStyleMemberships
2336 from Mailman.MemberAdaptor import BYBOUNCE, ENABLED
2337@@ -104,7 +104,7 @@
2338
2339
2340 def move_language_templates(mlist):
2341 listname = mlist.internal_name()
2342- print _('Fixing language templates: %(listname)s')
2343+ print C_('Fixing language templates: %(listname)s')
2344 # Mailman 2.1 has a new cascading search for its templates, defined and
2345 # described in Utils.py:maketext(). Putting templates in the top level
2346 # templates/ subdir or the lists/<listname> subdir is deprecated and no
2347@@ -193,8 +193,8 @@
2348 try:
2349 mlist.Lock(0.5)
2350 except TimeOutError:
2351- print >> sys.stderr, _('WARNING: could not acquire lock for list: '
2352- '%(listname)s')
2353+ print >> sys.stderr, C_('WARNING: could not acquire lock for list: '
2354+ '%(listname)s')
2355 return 1
2356
2357 # Sanity check the invariant that every BYBOUNCE disabled member must have
2358@@ -212,13 +212,13 @@
2359 # re-disable them if necessary.
2360 n = len(noinfo)
2361 if n > 0:
2362- print _(
2363+ print C_(
2364 'Resetting %(n)s BYBOUNCEs disabled addrs with no bounce info')
2365 for addr in noinfo.keys():
2366 mlist.setDeliveryStatus(addr, ENABLED)
2367
2368 # Update the held requests database
2369- print _("""Updating the held requests database.""")
2370+ print C_("""Updating the held requests database.""")
2371 mlist._UpdateRecords()
2372
2373 mbox_dir = make_varabs('archives/private/%s.mbox' % (listname))
2374@@ -240,7 +240,7 @@
2375 else:
2376 # this shouldn't happen, but hey, just in case
2377 if not os.path.isdir(mbox_dir):
2378- print _("""\
2379+ print C_("""\
2380 For some reason, %(mbox_dir)s exists as a file. This won't work with
2381 b6, so I'm renaming it to %(mbox_dir)s.tmp and proceeding.""")
2382 os.rename(mbox_dir, "%s.tmp" % (mbox_dir))
2383@@ -252,7 +252,7 @@
2384 # private one existing
2385 if os.path.isfile(o_pri_mbox_file) and os.path.isfile(o_pub_mbox_file):
2386 if mlist.archive_private:
2387- print _("""\
2388+ print C_("""\
2389
2390 %(listname)s has both public and private mbox archives. Since this list
2391 currently uses private archiving, I'm installing the private mbox archive
2392@@ -267,7 +267,7 @@
2393 o_pub_mbox_file)
2394 os.rename(o_pub_mbox_file, "%s.preb6" % (o_pub_mbox_file))
2395 else:
2396- print _("""\
2397+ print C_("""\
2398 %s has both public and private mbox archives. Since this list
2399 currently uses public archiving, I'm installing the public mbox file
2400 archive file (%s) as the active one, and renaming
2401@@ -284,7 +284,7 @@
2402 # move private archive mbox there if it's around
2403 # and take into account all sorts of absurdities
2404 #
2405- print _('- updating old private mbox file')
2406+ print C_('- updating old private mbox file')
2407 if os.path.exists(o_pri_mbox_file):
2408 if os.path.isfile(o_pri_mbox_file):
2409 os.rename(o_pri_mbox_file, mbox_file)
2410@@ -292,21 +292,21 @@
2411 newname = "%s.mm_install-dunno_what_this_was_but_its_in_the_way" \
2412 % o_pri_mbox_file
2413 os.rename(o_pri_mbox_file, newname)
2414- print _("""\
2415+ print C_("""\
2416 unknown file in the way, moving
2417 %(o_pri_mbox_file)s
2418 to
2419 %(newname)s""")
2420 else:
2421 # directory
2422- print _('Nothing to do.')
2423+ print C_('Nothing to do.')
2424
2425
2426 #
2427 # move public archive mbox there if it's around
2428 # and take into account all sorts of absurdities.
2429 #
2430- print _('- updating old public mbox file')
2431+ print C_('- updating old public mbox file')
2432 if os.path.exists(o_pub_mbox_file):
2433 if os.path.isfile(o_pub_mbox_file):
2434 os.rename(o_pub_mbox_file, mbox_file)
2435@@ -314,13 +314,13 @@
2436 newname = "%s.mm_install-dunno_what_this_was_but_its_in_the_way" \
2437 % o_pub_mbox_file
2438 os.rename(o_pub_mbox_file, newname)
2439- print _("""\
2440+ print C_("""\
2441 unknown file in the way, moving
2442 %(o_pub_mbox_file)s
2443 to
2444 %(newname)s""")
2445 else: # directory
2446- print _('Nothing to do.')
2447+ print C_('Nothing to do.')
2448
2449 #
2450 # move the html archives there
2451@@ -350,7 +350,7 @@
2452 b4_tmpl_dir = os.path.join(tmpl_dir, mlist._internal_name)
2453 new_tmpl_dir = os.path.join(list_dir, mlist._internal_name)
2454 if os.path.exists(b4_tmpl_dir):
2455- print _("""\
2456+ print C_("""\
2457 - This list looks like it might have <= b4 list templates around""")
2458 for f in os.listdir(b4_tmpl_dir):
2459 o_tmpl = os.path.join(b4_tmpl_dir, f)
2460@@ -358,12 +358,12 @@
2461 if os.path.exists(o_tmpl):
2462 if not os.path.exists(n_tmpl):
2463 os.rename(o_tmpl, n_tmpl)
2464- print _('- moved %(o_tmpl)s to %(n_tmpl)s')
2465+ print C_('- moved %(o_tmpl)s to %(n_tmpl)s')
2466 else:
2467- print _("""\
2468+ print C_("""\
2469 - both %(o_tmpl)s and %(n_tmpl)s exist, leaving untouched""")
2470 else:
2471- print _("""\
2472+ print C_("""\
2473 - %(o_tmpl)s doesn't exist, leaving untouched""")
2474 #
2475 # Move all the templates to the en language subdirectory as required for
2476@@ -393,23 +393,23 @@
2477 src = '%s/%s' % (mm_cfg.PREFIX, module)
2478 pyc = src + "c"
2479 if os.path.isdir(src):
2480- print _('removing directory %(src)s and everything underneath')
2481+ print C_('removing directory %(src)s and everything underneath')
2482 shutil.rmtree(src)
2483 elif os.path.exists(src):
2484- print _('removing %(src)s')
2485+ print C_('removing %(src)s')
2486 try:
2487 os.unlink(src)
2488 except os.error, rest:
2489- print _("Warning: couldn't remove %(src)s -- %(rest)s")
2490+ print C_("Warning: couldn't remove %(src)s -- %(rest)s")
2491 if module.endswith('.py') and os.path.exists(pyc):
2492 try:
2493 os.unlink(pyc)
2494 except os.error, rest:
2495- print _("couldn't remove old file %(pyc)s -- %(rest)s")
2496+ print C_("couldn't remove old file %(pyc)s -- %(rest)s")
2497
2498
2499
2500 def update_qfiles():
2501- print _('updating old qfiles')
2502+ print C_('updating old qfiles')
2503 prefix = `time.time()` + '+'
2504 # Be sure the qfiles/in directory exists (we don't really need the
2505 # switchboard object, but it's convenient for creating the directory).
2506@@ -452,7 +452,7 @@
2507 except EnvironmentError, e:
2508 if e.errno <> errno.ENOTDIR:
2509 raise
2510- print _('Warning! Not a directory: %(dirpath)s')
2511+ print C_('Warning! Not a directory: %(dirpath)s')
2512
2513
2514
2515
2516@@ -527,7 +527,7 @@
2517 # This message was unparsable, most likely because its
2518 # MIME encapsulation was broken. For now, there's not
2519 # much we can do about it.
2520- print _('message is unparsable: %(filebase)s')
2521+ print C_('message is unparsable: %(filebase)s')
2522 msgfp.close()
2523 msgfp = None
2524 if mm_cfg.QRUNNER_SAVE_BAD_MESSAGES:
2525@@ -541,7 +541,7 @@
2526 msg = data = None
2527 except EOFError:
2528 # For some reason the pckfile was empty. Just delete it.
2529- print _('Warning! Deleting empty .pck file: %(pckfile)s')
2530+ print C_('Warning! Deleting empty .pck file: %(pckfile)s')
2531 os.unlink(pckfile)
2532 finally:
2533 if msgfp:
2534@@ -560,7 +560,7 @@
2535 except IOError, e:
2536 if e.errno <> errno.ENOENT: raise
2537 else:
2538- print _('Updating Mailman 2.0 pending_subscriptions.db database')
2539+ print C_('Updating Mailman 2.0 pending_subscriptions.db database')
2540 db = marshal.load(fp)
2541 # Convert to the pre-Mailman 2.1.5 format
2542 db = Pending._update(db)
2543@@ -571,10 +571,10 @@
2544 except IOError, e:
2545 if e.errno <> errno.ENOENT: raise
2546 else:
2547- print _('Updating Mailman 2.1.4 pending.pck database')
2548+ print C_('Updating Mailman 2.1.4 pending.pck database')
2549 db = cPickle.load(fp)
2550 if db is None:
2551- print _('Nothing to do.')
2552+ print C_('Nothing to do.')
2553 return
2554 # Now upgrade the database to the 2.1.5 format. Each list now has its own
2555 # pending.pck file, but only the RE_ENABLE operation actually recorded the
2556@@ -595,7 +595,7 @@
2557 op = val[0]
2558 data = val[1:]
2559 except (IndexError, ValueError):
2560- print _('Ignoring bad pended data: %(key)s: %(val)s')
2561+ print C_('Ignoring bad pended data: %(key)s: %(val)s')
2562 continue
2563 if op in (Pending.UNSUBSCRIPTION, Pending.CHANGE_OF_ADDRESS):
2564 # data[0] is the address being unsubscribed
2565@@ -611,7 +611,7 @@
2566 # data[0] is the hold id. There better only be one entry per id
2567 id = data[0]
2568 if holds_by_id.has_key(id):
2569- print _('WARNING: Ignoring duplicate pending ID: %(id)s.')
2570+ print C_('WARNING: Ignoring duplicate pending ID: %(id)s.')
2571 else:
2572 holds_by_id[id] = (key, val)
2573 # Now we have to lock every list and re-pend all the appropriate
2574@@ -664,7 +664,7 @@
2575 def main():
2576 errors = 0
2577 # get rid of old stuff
2578- print _('getting rid of old source files')
2579+ print C_('getting rid of old source files')
2580 for mod in ('Mailman/Archiver.py', 'Mailman/HyperArch.py',
2581 'Mailman/HyperDatabase.py', 'Mailman/pipermail.py',
2582 'Mailman/smtplib.py', 'Mailman/Cookie.py',
2583@@ -674,29 +674,29 @@
2584 remove_old_sources(mod)
2585 listnames = Utils.list_names()
2586 if not listnames:
2587- print _('no lists == nothing to do, exiting')
2588+ print C_('no lists == nothing to do, exiting')
2589 return
2590 #
2591 # for people with web archiving, make sure the directories
2592 # in the archiving are set with proper perms for b6.
2593 #
2594 if os.path.isdir("%s/public_html/archives" % mm_cfg.PREFIX):
2595- print _("""\
2596+ print C_("""\
2597 fixing all the perms on your old html archives to work with b6
2598 If your archives are big, this could take a minute or two...""")
2599 os.path.walk("%s/public_html/archives" % mm_cfg.PREFIX,
2600 archive_path_fixer, "")
2601- print _('done')
2602+ print C_('done')
2603 for listname in listnames:
2604- print _('Updating mailing list: %(listname)s')
2605+ print C_('Updating mailing list: %(listname)s')
2606 errors = errors + dolist(listname)
2607 print
2608- print _('Updating Usenet watermarks')
2609+ print C_('Updating Usenet watermarks')
2610 wmfile = os.path.join(mm_cfg.DATA_DIR, 'gate_watermarks')
2611 try:
2612 fp = open(wmfile)
2613 except IOError:
2614- print _('- nothing to update here')
2615+ print C_('- nothing to update here')
2616 else:
2617 d = marshal.load(fp)
2618 fp.close()
2619@@ -708,7 +708,7 @@
2620 try:
2621 mlist.Lock(0.5)
2622 except TimeOutError:
2623- print >> sys.stderr, _(
2624+ print >> sys.stderr, C_(
2625 'WARNING: could not acquire lock for list: %(listname)s')
2626 errors = errors + 1
2627 else:
2628@@ -719,7 +719,7 @@
2629 mlist.Save()
2630 mlist.Unlock()
2631 os.unlink(wmfile)
2632- print _('- usenet watermarks updated and gate_watermarks removed')
2633+ print C_('- usenet watermarks updated and gate_watermarks removed')
2634 # In Mailman 2.1, the pending database format and file name changed, but
2635 # in Mailman 2.1.5 it changed again. This should update all existing
2636 # files to the 2.1.5 format.
2637@@ -733,7 +733,7 @@
2638 # There's no good way of figuring this out for releases prior to 2.0beta2
2639 # :(
2640 if lastversion == NOTFRESH:
2641- print _("""
2642+ print C_("""
2643
2644 NOTE NOTE NOTE NOTE NOTE
2645
2646@@ -760,7 +760,7 @@
2647 fd = sys.stderr
2648 else:
2649 fd = sys.stdout
2650- print >> fd, _(__doc__) % globals()
2651+ print >> fd, C_(__doc__) % globals()
2652 if msg:
2653 print >> sys.stderr, msg
2654 sys.exit(code)
2655@@ -790,15 +790,15 @@
2656 hextversion = hex(thisversion)
2657 if lastversion == thisversion and not force:
2658 # nothing to do
2659- print _('No updates are necessary.')
2660+ print C_('No updates are necessary.')
2661 sys.exit(0)
2662 if lastversion > thisversion and not force:
2663- print _("""\
2664+ print C_("""\
2665 Downgrade detected, from version %(hexlversion)s to version %(hextversion)s
2666 This is probably not safe.
2667 Exiting.""")
2668 sys.exit(1)
2669- print _('Upgrading from version %(hexlversion)s to %(hextversion)s')
2670+ print C_('Upgrading from version %(hexlversion)s to %(hextversion)s')
2671 errors = main()
2672 if not errors:
2673 # Record the version we just upgraded to
2674@@ -807,7 +807,7 @@
2675 fp.close()
2676 else:
2677 lockdir = mm_cfg.LOCK_DIR
2678- print _('''\
2679+ print C_('''\
2680
2681 ERROR:
2682
2683
2684=== modified file 'bin/version'
2685--- bin/version 2005-08-27 01:40:17 +0000
2686+++ bin/version 2016-02-26 10:03:26 +0000
2687@@ -21,6 +21,6 @@
2688
2689 import paths
2690 import Mailman.mm_cfg
2691-from Mailman.i18n import _
2692+from Mailman.i18n import C_
2693
2694-print _('Using Mailman version:'), Mailman.mm_cfg.VERSION
2695+print C_('Using Mailman version:'), Mailman.mm_cfg.VERSION
2696
2697=== modified file 'bin/withlist'
2698--- bin/withlist 2007-04-05 18:37:08 +0000
2699+++ bin/withlist 2016-02-26 10:03:26 +0000
2700@@ -128,7 +128,7 @@
2701 from Mailman import Errors
2702 from Mailman import MailList
2703 from Mailman import Utils
2704-from Mailman.i18n import _
2705+from Mailman.i18n import C_
2706
2707 try:
2708 True, False
2709@@ -154,7 +154,7 @@
2710 fd = sys.stderr
2711 else:
2712 fd = sys.stdout
2713- print >> fd, _(__doc__)
2714+ print >> fd, C_(__doc__)
2715 if msg:
2716 print >> fd, msg
2717 sys.exit(code)
2718@@ -172,11 +172,11 @@
2719 if m.Locked():
2720 if VERBOSE:
2721 listname = m.internal_name()
2722- print >> sys.stderr, _(
2723+ print >> sys.stderr, C_(
2724 'Unlocking (but not saving) list: %(listname)s')
2725 m.Unlock()
2726 if VERBOSE:
2727- print >> sys.stderr, _('Finalizing')
2728+ print >> sys.stderr, C_('Finalizing')
2729 del m
2730
2731
2732@@ -185,16 +185,16 @@
2733 global m
2734 # first try to open mailing list
2735 if VERBOSE:
2736- print >> sys.stderr, _('Loading list %(listname)s'),
2737+ print >> sys.stderr, C_('Loading list %(listname)s'),
2738 if LOCK:
2739- print >> sys.stderr, _('(locked)')
2740+ print >> sys.stderr, C_('(locked)')
2741 else:
2742- print >> sys.stderr, _('(unlocked)')
2743+ print >> sys.stderr, C_('(unlocked)')
2744
2745 try:
2746 m = MailList.MailList(listname, lock=LOCK)
2747 except Errors.MMUnknownListError:
2748- print >> sys.stderr, _('Unknown list: %(listname)s')
2749+ print >> sys.stderr, C_('Unknown list: %(listname)s')
2750 m = None
2751
2752 # try to import the module and run the callable
2753@@ -234,7 +234,7 @@
2754 all = True
2755
2756 if len(args) < 1 and not all:
2757- warning = _('No list name supplied.')
2758+ warning = C_('No list name supplied.')
2759 if interact:
2760 # Let them keep going
2761 print warning
2762@@ -243,7 +243,7 @@
2763 usage(1, warning)
2764
2765 if all and not run:
2766- usage(1, _('--all requires --run'))
2767+ usage(1, C_('--all requires --run'))
2768
2769 # The default for interact is 1 unless -r was given
2770 if interact is None:
2771@@ -263,11 +263,11 @@
2772 module = run[:i]
2773 callable = run[i+1:]
2774 if VERBOSE:
2775- print >> sys.stderr, _('Importing %(module)s...')
2776+ print >> sys.stderr, C_('Importing %(module)s...')
2777 __import__(module)
2778 mod = sys.modules[module]
2779 if VERBOSE:
2780- print >> sys.stderr, _('Running %(module)s.%(callable)s()...')
2781+ print >> sys.stderr, C_('Running %(module)s.%(callable)s()...')
2782 func = getattr(mod, callable)
2783
2784 if all:
2785@@ -288,7 +288,7 @@
2786 namespace = globals().copy()
2787 namespace.update(locals())
2788 if dolist:
2789- ban = _("The variable `m' is the %(listname)s MailList instance")
2790+ ban = C_("The variable `m' is the %(listname)s MailList instance")
2791 else:
2792 ban = None
2793 code.InteractiveConsole(namespace).interact(ban)
2794
2795=== modified file 'messages/Makefile.in'
2796--- messages/Makefile.in 2013-05-20 15:19:19 +0000
2797+++ messages/Makefile.in 2016-02-26 10:03:26 +0000
2798@@ -138,7 +138,7 @@
2799
2800 potfile: marked.files docstring.files
2801 @echo "Running pygettext on $@; this make take a while."
2802- (cd ..; $(PROG) -p messages -d mailman -D -X messages/marked.files `cat messages/marked.files messages/docstring.files`)
2803+ (cd ..; $(PROG) -k C_ -p messages -d mailman -D -X messages/marked.files `cat messages/marked.files messages/docstring.files`)
2804
2805 # Update the individual mailman.po files with the new changes to the
2806 # .pot file