/[smecontribs]/rpms/mailman/contribs10/mailman-2.1.12-lctype.patch
ViewVC logotype

Annotation of /rpms/mailman/contribs10/mailman-2.1.12-lctype.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Mon Feb 22 15:33:49 2021 UTC (3 years, 2 months ago) by brianr
Branch: MAIN
CVS Tags: HEAD
Initial import

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

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed