-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmailman-2.1.12-lctype.patch
2503 lines (2273 loc) · 85 KB
/
mailman-2.1.12-lctype.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -ruN mailman-2.1.12-a/bin/add_members mailman-2.1.12-b/bin/add_members
--- mailman-2.1.12-a/bin/add_members 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/add_members 2009-07-28 12:19:54.000000000 +0200
@@ -80,7 +80,7 @@
from Mailman import mm_cfg
from Mailman import i18n
-_ = i18n._
+C_ = i18n.C_
@@ -89,7 +89,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(status)
@@ -134,19 +134,19 @@
try:
mlist.ApprovedAddMember(userdesc, ack, 0)
except Errors.MMAlreadyAMember:
- print >> tee, _('Already a member: %(member)s')
+ print >> tee, C_('Already a member: %(member)s')
except Errors.MembershipIsBanned, pattern:
print >> tee, ('%s:' %
- member), _('Banned address (matched %(pattern)s)')
+ member), C_('Banned address (matched %(pattern)s)')
except Errors.MMBadEmailError:
if userdesc.address == '':
- print >> tee, _('Bad/Invalid email address: blank line')
+ print >> tee, C_('Bad/Invalid email address: blank line')
else:
- print >> tee, _('Bad/Invalid email address: %(member)s')
+ print >> tee, C_('Bad/Invalid email address: %(member)s')
except Errors.MMHostileAddress:
- print >> tee, _('Hostile address (illegal characters): %(member)s')
+ print >> tee, C_('Hostile address (illegal characters): %(member)s')
else:
- print >> tee, _('Subscribed: %(member)s')
+ print >> tee, C_('Subscribed: %(member)s')
@@ -191,26 +191,26 @@
elif arg.lower()[0] == 'n':
send_welcome_msg = 0
else:
- usage(1, _('Bad argument to -w/--welcome-msg: %(arg)s'))
+ usage(1, C_('Bad argument to -w/--welcome-msg: %(arg)s'))
elif opt in ('-a', '--admin-notify'):
if arg.lower()[0] == 'y':
admin_notif = 1
elif arg.lower()[0] == 'n':
admin_notif = 0
else:
- usage(1, _('Bad argument to -a/--admin-notify: %(arg)s'))
+ usage(1, C_('Bad argument to -a/--admin-notify: %(arg)s'))
if dfile is None and nfile is None:
usage(1)
if dfile == "-" and nfile == "-":
- usage(1, _('Cannot read both digest and normal members '
+ usage(1, C_('Cannot read both digest and normal members '
'from standard input.'))
try:
mlist = MailList.MailList(listname)
except Errors.MMUnknownListError:
- usage(1, _('No such list: %(listname)s'))
+ usage(1, C_('No such list: %(listname)s'))
# Set up defaults
if send_welcome_msg is None:
@@ -230,7 +230,7 @@
nmembers = readfile(nfile)
if not dmembers and not nmembers:
- usage(0, _('Nothing to do.'))
+ usage(0, C_('Nothing to do.'))
s = StringIO()
i18n.set_language(mlist.preferred_language)
@@ -242,7 +242,7 @@
if admin_notif:
realname = mlist.real_name
- subject = _('%(realname)s subscription notification')
+ subject = C_('%(realname)s subscription notification')
msg = Message.UserNotification(
mlist.owner, Utils.get_site_email(), subject, s.getvalue(),
mlist.preferred_language)
diff -ruN mailman-2.1.12-a/bin/arch mailman-2.1.12-b/bin/arch
--- mailman-2.1.12-a/bin/arch 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/arch 2009-07-28 12:19:54.000000000 +0200
@@ -70,7 +70,7 @@
from Mailman.LockFile import LockFile
from Mailman import i18n
-_ = i18n._
+C_ = i18n.C_
PROGRAM = sys.argv[0]
i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
@@ -82,7 +82,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -122,7 +122,7 @@
# grok arguments
if len(args) < 1:
- usage(1, _('listname is required'))
+ usage(1, C_('listname is required'))
listname = args[0].lower().strip()
if len(args) < 2:
@@ -140,7 +140,7 @@
try:
mlist = MailList(listname)
except Errors.MMListError, e:
- usage(2, _('No such list "%(listname)s"\n%(e)s'))
+ usage(2, C_('No such list "%(listname)s"\n%(e)s'))
if mbox is None:
mbox = mlist.ArchiveFileName()
@@ -165,7 +165,7 @@
try:
fp = open(mbox)
except IOError, msg:
- usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s'))
+ usage(3, C_('Cannot open mbox file %(mbox)s: %(msg)s'))
# Maybe wipe the old archives
if wipe:
if mlist.scrub_nondigest:
diff -ruN mailman-2.1.12-a/bin/b4b5-archfix mailman-2.1.12-b/bin/b4b5-archfix
--- mailman-2.1.12-a/bin/b4b5-archfix 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/b4b5-archfix 2009-07-28 12:19:54.000000000 +0200
@@ -44,7 +44,7 @@
# Required to get the right classes for unpickling
import paths
-from Mailman.i18n import _
+from Mailman.i18n import C_
PROGRAM = sys.argv[0]
@@ -55,7 +55,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
diff -ruN mailman-2.1.12-a/bin/change_pw mailman-2.1.12-b/bin/change_pw
--- mailman-2.1.12-a/bin/change_pw 2009-07-28 12:19:50.000000000 +0200
+++ mailman-2.1.12-b/bin/change_pw 2009-07-28 12:19:54.000000000 +0200
@@ -76,7 +76,7 @@
from Mailman import Message
from Mailman import i18n
-_ = i18n._
+C_ = i18n.C_
SPACE = ' '
@@ -87,7 +87,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -103,7 +103,7 @@
try:
mlist = MailList.MailList(listname, lock=0)
except Errors.MMListError, e:
- usage(1, _('No such list "%(listname)s"\n%(e)s'))
+ usage(1, C_('No such list "%(listname)s"\n%(e)s'))
_listcache[listname] = mlist
return mlist
@@ -141,11 +141,11 @@
if args:
strargs = SPACE.join(args)
- usage(1, _('Bad arguments: %(strargs)s'))
+ usage(1, C_('Bad arguments: %(strargs)s'))
if password is not None:
if not password:
- usage(1, _('Empty list passwords are not allowed'))
+ usage(1, C_('Empty list passwords are not allowed'))
shapassword = Utils.sha_new(password).hexdigest()
if domains:
@@ -155,7 +155,7 @@
listnames[name] = 1
if not listnames:
- print >> sys.stderr, _('Nothing to do.')
+ print >> sys.stderr, C_('Nothing to do.')
sys.exit(0)
# Set the password on the lists
@@ -177,7 +177,7 @@
mlist.Unlock()
# Notification
- print _('New %(listname)s password: %(notifypassword)s')
+ print C_('New %(listname)s password: %(notifypassword)s')
if not quiet:
otrans = i18n.get_translation()
i18n.set_language(mlist.preferred_language)
diff -ruN mailman-2.1.12-a/bin/check_db mailman-2.1.12-b/bin/check_db
--- mailman-2.1.12-a/bin/check_db 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/check_db 2009-07-28 12:19:54.000000000 +0200
@@ -59,7 +59,7 @@
from Mailman import mm_cfg
from Mailman import Utils
from Mailman.MailList import MailList
-from Mailman.i18n import _
+from Mailman.i18n import C_
PROGRAM = sys.argv[0]
@@ -70,7 +70,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -111,12 +111,12 @@
listnames = [n.lower().strip() for n in listnames]
if not listnames:
- print _('Nothing to do.')
+ print C_('Nothing to do.')
sys.exit(0)
for listname in listnames:
if not Utils.list_exists(listname):
- print _('No list named:'), listname
+ print C_('No list named:'), listname
continue
mlist = MailList(listname, lock=0)
pfile = os.path.join(mlist.fullpath(), 'config.pck')
@@ -125,7 +125,7 @@
dlast = dfile + '.last'
if verbose:
- print _('List:'), listname
+ print C_('List:'), listname
for file in (pfile, plast, dfile, dlast):
status = 0
@@ -145,7 +145,7 @@
else:
print ' %s: %s' % (file, status)
elif verbose:
- print _(' %(file)s: okay')
+ print C_(' %(file)s: okay')
diff -ruN mailman-2.1.12-a/bin/check_perms mailman-2.1.12-b/bin/check_perms
--- mailman-2.1.12-a/bin/check_perms 2009-07-28 12:19:50.000000000 +0200
+++ mailman-2.1.12-b/bin/check_perms 2009-07-28 12:19:54.000000000 +0200
@@ -45,7 +45,7 @@
raise
from Mailman import mm_cfg
from Mailman.mm_cfg import MAILMAN_USER, MAILMAN_GROUP
-from Mailman.i18n import _
+from Mailman.i18n import C_
# Let KeyErrors percolate
MAILMAN_GID = grp.getgrnam(MAILMAN_GROUP)[2]
@@ -107,7 +107,7 @@
for name in names:
path = os.path.join(dirname, name)
if arg.VERBOSE:
- print _(' checking gid and mode for %(path)s')
+ print C_(' checking gid and mode for %(path)s')
try:
mode, gid = statgidmode(path)
except OSError, e:
@@ -119,10 +119,10 @@
except KeyError:
groupname = '<anon gid %d>' % gid
arg.ERRORS += 1
- print _('%(path)s bad group (has: %(groupname)s, '
+ print C_('%(path)s bad group (has: %(groupname)s, '
'expected %(MAILMAN_GROUP)s)'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chown(path, -1, MAILMAN_GID)
else:
print
@@ -148,19 +148,19 @@
octperms = oct(targetperms)
if S_ISDIR(mode) and (mode & targetperms) <> targetperms:
arg.ERRORS += 1
- print _('directory permissions must be %(octperms)s: %(path)s'),
+ print C_('directory permissions must be %(octperms)s: %(path)s'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(path, mode | targetperms)
else:
print
elif os.path.splitext(path)[1] in ('.py', '.pyc', '.pyo'):
octperms = oct(PYFILEPERMS)
if mode & PYFILEPERMS <> PYFILEPERMS:
- print _('source perms must be %(octperms)s: %(path)s'),
+ print C_('source perms must be %(octperms)s: %(path)s'),
arg.ERRORS += 1
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(path, mode | PYFILEPERMS)
else:
print
@@ -168,10 +168,10 @@
# Article files must be group writeable
octperms = oct(ARTICLEFILEPERMS)
if mode & ARTICLEFILEPERMS <> ARTICLEFILEPERMS:
- print _('article db files must be %(octperms)s: %(path)s'),
+ print C_('article db files must be %(octperms)s: %(path)s'),
arg.ERRORS += 1
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(path, mode | ARTICLEFILEPERMS)
else:
print
@@ -180,7 +180,7 @@
# first check PREFIX
if STATE.VERBOSE:
prefix = mm_cfg.PREFIX
- print _('checking mode for %(prefix)s')
+ print C_('checking mode for %(prefix)s')
dirs = {}
for d in (mm_cfg.PREFIX, mm_cfg.EXEC_PREFIX, mm_cfg.VAR_PREFIX,
mm_cfg.CONFIG_DIR, mm_cfg.DATA_DIR, mm_cfg.LOCK_DIR,
@@ -191,13 +191,13 @@
mode = statmode(d)
except OSError, e:
if e.errno <> errno.ENOENT: raise
- print _('WARNING: directory does not exist: %(d)s')
+ print C_('WARNING: directory does not exist: %(d)s')
continue
if (mode & DIRPERMS) <> DIRPERMS:
STATE.ERRORS += 1
- print _('directory must be at least 02775: %(d)s'),
+ print C_('directory must be at least 02775: %(d)s'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(d, mode | DIRPERMS)
else:
print
@@ -207,14 +207,14 @@
def checkarchives():
private = mm_cfg.PRIVATE_ARCHIVE_FILE_DIR
if STATE.VERBOSE:
- print _('checking perms on %(private)s')
+ print C_('checking perms on %(private)s')
# private archives must not be other readable
mode = statmode(private)
if mode & S_IROTH:
STATE.ERRORS += 1
- print _('%(private)s must not be other-readable'),
+ print C_('%(private)s must not be other-readable'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(private, mode & ~S_IROTH)
else:
print
@@ -238,9 +238,9 @@
mode = statmode(mboxfile)
if (mode & MBOXPERMS) <> MBOXPERMS:
STATE.ERRORS = STATE.ERRORS + 1
- print _('mbox file must be at least 0660:'), mboxfile
+ print C_('mbox file must be at least 0660:'), mboxfile
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(mboxfile, mode | MBOXPERMS)
else:
print
@@ -261,9 +261,9 @@
continue
if mode & S_IRWXO:
STATE.ERRORS += 1
- print _('%(dbdir)s "other" perms must be 000'),
+ print C_('%(dbdir)s "other" perms must be 000'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(dbdir, mode & ~S_IRWXO)
else:
print
@@ -271,18 +271,18 @@
def checkcgi():
cgidir = os.path.join(mm_cfg.EXEC_PREFIX, 'cgi-bin')
if STATE.VERBOSE:
- print _('checking cgi-bin permissions')
+ print C_('checking cgi-bin permissions')
exes = os.listdir(cgidir)
for f in exes:
path = os.path.join(cgidir, f)
if STATE.VERBOSE:
- print _(' checking set-gid for %(path)s')
+ print C_(' checking set-gid for %(path)s')
mode = statmode(path)
if mode & S_IXGRP and not mode & S_ISGID:
STATE.ERRORS += 1
- print _('%(path)s must be set-gid'),
+ print C_('%(path)s must be set-gid'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(path, mode | S_ISGID)
else:
print
@@ -290,13 +290,13 @@
def checkmail():
wrapper = os.path.join(mm_cfg.WRAPPER_DIR, 'mailman')
if STATE.VERBOSE:
- print _('checking set-gid for %(wrapper)s')
+ print C_('checking set-gid for %(wrapper)s')
mode = statmode(wrapper)
if not mode & S_ISGID:
STATE.ERRORS += 1
- print _('%(wrapper)s must be set-gid'),
+ print C_('%(wrapper)s must be set-gid'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(wrapper, mode | S_ISGID)
def checkadminpw():
@@ -304,7 +304,7 @@
os.path.join(mm_cfg.DATA_DIR, 'creator.pw')):
targetmode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP
if STATE.VERBOSE:
- print _('checking permissions on %(pwfile)s')
+ print C_('checking permissions on %(pwfile)s')
try:
mode = statmode(pwfile)
except OSError, e:
@@ -313,10 +313,10 @@
if mode <> targetmode:
STATE.ERRORS += 1
octmode = oct(mode)
- print _('%(pwfile)s permissions must be exactly 0640 '
+ print C_('%(pwfile)s permissions must be exactly 0640 '
'(got %(octmode)s)'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(pwfile, targetmode)
else:
print
@@ -338,13 +338,13 @@
'digest.mbox', 'pending.pck',
'request.db', 'request.db.tmp')
if STATE.VERBOSE:
- print _('checking permissions on list data')
+ print C_('checking permissions on list data')
# BAW: This needs to be converted to the Site module abstraction
for dir in os.listdir(mm_cfg.LIST_DATA_DIR):
for file in checkfiles:
path = os.path.join(mm_cfg.LIST_DATA_DIR, dir, file)
if STATE.VERBOSE:
- print _(' checking permissions on: %(path)s')
+ print C_(' checking permissions on: %(path)s')
try:
mode = statmode(path)
except OSError, e:
@@ -352,9 +352,9 @@
continue
if (mode & targetmode) <> targetmode:
STATE.ERRORS += 1
- print _('file permissions must be at least 660: %(path)s'),
+ print C_('file permissions must be at least 660: %(path)s'),
if STATE.FIX:
- print _('(fixing)')
+ print C_('(fixing)')
os.chmod(path, mode | targetmode)
else:
print
@@ -366,7 +366,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -397,7 +397,7 @@
checkmta()
if not STATE.ERRORS:
- print _('No problems found')
+ print C_('No problems found')
else:
- print _('Problems found:'), STATE.ERRORS
- print _('Re-run as %(MAILMAN_USER)s (or root) with -f flag to fix')
+ print C_('Problems found:'), STATE.ERRORS
+ print C_('Re-run as %(MAILMAN_USER)s (or root) with -f flag to fix')
diff -ruN mailman-2.1.12-a/bin/cleanarch mailman-2.1.12-b/bin/cleanarch
--- mailman-2.1.12-a/bin/cleanarch 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/cleanarch 2009-07-28 12:19:54.000000000 +0200
@@ -53,7 +53,7 @@
import mailbox
import paths
-from Mailman.i18n import _
+from Mailman.i18n import C_
cre = re.compile(mailbox.UnixMailbox._fromlinepattern)
@@ -69,7 +69,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -80,7 +80,7 @@
if output:
sys.stdout.write('>' + line)
if not quiet:
- print >> sys.stderr, _('Unix-From line changed: %(lineno)d')
+ print >> sys.stderr, C_('Unix-From line changed: %(lineno)d')
print >> sys.stderr, line[:-1]
@@ -108,7 +108,7 @@
try:
status = int(arg)
except ValueError:
- usage(1, _('Bad status number: %(arg)s'))
+ usage(1, C_('Bad status number: %(arg)s'))
if args:
usage(1)
@@ -164,7 +164,7 @@
print >> sys.stderr
statuscnt = 0
prevline = line
- print >> sys.stderr, _('%(messages)d messages found')
+ print >> sys.stderr, C_('%(messages)d messages found')
diff -ruN mailman-2.1.12-a/bin/clone_member mailman-2.1.12-b/bin/clone_member
--- mailman-2.1.12-a/bin/clone_member 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/clone_member 2009-07-28 12:19:54.000000000 +0200
@@ -72,7 +72,7 @@
from Mailman import MailList
from Mailman import Utils
from Mailman import Errors
-from Mailman.i18n import _
+from Mailman.i18n import C_
@@ -81,7 +81,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -91,14 +91,14 @@
def dolist(mlist, options):
SPACE = ' '
if not options.quiet:
- print _('processing mailing list:'), mlist.internal_name()
+ print C_('processing mailing list:'), mlist.internal_name()
# scan the list owners. TBD: mlist.owner keys should be lowercase?
oldowners = mlist.owner[:]
oldowners.sort()
if options.admintoo:
if not options.quiet:
- print _(' scanning list owners:'), SPACE.join(oldowners)
+ print C_(' scanning list owners:'), SPACE.join(oldowners)
newowners = {}
foundp = 0
for owner in mlist.owner:
@@ -116,9 +116,9 @@
if not options.quiet:
if newowners <> oldowners:
print
- print _(' new list owners:'), SPACE.join(newowners)
+ print C_(' new list owners:'), SPACE.join(newowners)
else:
- print _('(no change)')
+ print C_('(no change)')
# see if the fromaddr is a digest member or regular member
if options.lfromaddr in mlist.getDigestMemberKeys():
@@ -127,13 +127,13 @@
digest = 0
else:
if not options.quiet:
- print _(' address not found:'), options.fromaddr
+ print C_(' address not found:'), options.fromaddr
return
# Check for banned to address.
pattern = mlist.GetBannedPattern(options.toaddr)
if pattern:
if not options.quiet:
- print ' ', _('Banned address (matched %(pattern)s)')
+ print ' ', C_('Banned address (matched %(pattern)s)')
return
# Now change the membership address
@@ -142,13 +142,13 @@
mlist.changeMemberAddress(options.fromaddr, options.toaddr,
not options.remove)
if not options.quiet:
- print _(' clone address added:'), options.toaddr
+ print C_(' clone address added:'), options.toaddr
except Errors.MMAlreadyAMember:
if not options.quiet:
- print _(' clone address is already a member:'), options.toaddr
+ print C_(' clone address is already a member:'), options.toaddr
if options.remove:
- print _(' original address removed:'), options.fromaddr
+ print C_(' original address removed:'), options.fromaddr
@@ -199,7 +199,7 @@
try:
Utils.ValidateEmail(toaddr)
except Errors.EmailAddressError:
- usage(1, _('Not a valid email address: %(toaddr)s'))
+ usage(1, C_('Not a valid email address: %(toaddr)s'))
lfromaddr = fromaddr.lower()
options.toaddr = toaddr
options.fromaddr = fromaddr
@@ -212,7 +212,7 @@
try:
mlist = MailList.MailList(listname)
except Errors.MMListError, e:
- print _('Error opening list "%(listname)s", skipping.\n%(e)s')
+ print C_('Error opening list "%(listname)s", skipping.\n%(e)s')
continue
try:
dolist(mlist, options)
diff -ruN mailman-2.1.12-a/bin/config_list mailman-2.1.12-b/bin/config_list
--- mailman-2.1.12-a/bin/config_list 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/config_list 2009-07-28 12:19:54.000000000 +0200
@@ -75,7 +75,7 @@
from Mailman import Errors
from Mailman import i18n
-_ = i18n._
+C_ = i18n.C_
NL = '\n'
nonasciipat = re.compile(r'[\x80-\xff]')
@@ -87,7 +87,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -106,7 +106,7 @@
try:
mlist = MailList.MailList(listname, lock=0)
except Errors.MMListError:
- usage(1, _('No such list: %(listname)s'))
+ usage(1, C_('No such list: %(listname)s'))
# Preamble for the config info. PEP263 charset and capture time.
language = mlist.preferred_language
charset = Utils.GetCharSet(language)
@@ -114,7 +114,7 @@
if not charset:
charset = 'us-ascii'
when = time.ctime(time.time())
- print >> outfp, _('''\
+ print >> outfp, C_('''\
# -*- python -*-
# -*- coding: %(charset)s -*-
## "%(listname)s" mailing list configuration settings
@@ -140,7 +140,7 @@
if info is None:
return
charset = Utils.GetCharSet(mlist.preferred_language)
- print >> outfp, '##', k.capitalize(), _('options')
+ print >> outfp, '##', k.capitalize(), C_('options')
print >> outfp, '#'
# First, massage the descripton text, which could have obnoxious
# leading whitespace on second and subsequent lines due to
@@ -199,7 +199,7 @@
outfp.write('"""\n')
elif vtype in (mm_cfg.Radio, mm_cfg.Toggle):
print >> outfp, '#'
- print >> outfp, '#', _('legal values are:')
+ print >> outfp, '#', C_('legal values are:')
# TBD: This is disgusting, but it's special cased
# everywhere else anyway...
if varname == 'subscribe_policy' and \
@@ -253,7 +253,7 @@
try:
mlist = MailList.MailList(listname, lock=not checkonly)
except Errors.MMListError, e:
- usage(1, _('No such list "%(listname)s"\n%(e)s'))
+ usage(1, C_('No such list "%(listname)s"\n%(e)s'))
savelist = 0
guibyprop = getPropertyMap(mlist)
try:
@@ -266,16 +266,16 @@
if k in ('mlist', '__builtins__'):
continue
if not hasattr(mlist, k):
- print >> sys.stderr, _('attribute "%(k)s" ignored')
+ print >> sys.stderr, C_('attribute "%(k)s" ignored')
continue
if verbose:
- print >> sys.stderr, _('attribute "%(k)s" changed')
+ print >> sys.stderr, C_('attribute "%(k)s" changed')
missing = []
gui, wtype = guibyprop.get(k, (missing, missing))
if gui is missing:
# This isn't an official property of the list, but that's
# okay, we'll just restore it the old fashioned way
- print >> sys.stderr, _('Non-standard property restored: %(k)s')
+ print >> sys.stderr, C_('Non-standard property restored: %(k)s')
setattr(mlist, k, v)
else:
# BAW: This uses non-public methods. This logic taken from
@@ -283,9 +283,9 @@
try:
validval = gui._getValidValue(mlist, k, wtype, v)
except ValueError:
- print >> sys.stderr, _('Invalid value for property: %(k)s')
+ print >> sys.stderr, C_('Invalid value for property: %(k)s')
except Errors.EmailAddressError:
- print >> sys.stderr, _(
+ print >> sys.stderr, C_(
'Bad email address for option %(k)s: %(v)s')
else:
# BAW: Horrible hack, but then this is special cased
@@ -342,13 +342,13 @@
# sanity check
if infile is not None and outfile is not None:
- usage(1, _('Only one of -i or -o is allowed'))
+ usage(1, C_('Only one of -i or -o is allowed'))
if infile is None and outfile is None:
- usage(1, _('One of -i or -o is required'))
+ usage(1, C_('One of -i or -o is required'))
# get the list name
if len(args) <> 1:
- usage(1, _('List name is required'))
+ usage(1, C_('List name is required'))
listname = args[0].lower().strip()
if outfile:
diff -ruN mailman-2.1.12-a/bin/convert.py mailman-2.1.12-b/bin/convert.py
--- mailman-2.1.12-a/bin/convert.py 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/convert.py 2009-07-28 12:19:54.000000000 +0200
@@ -25,7 +25,7 @@
import paths
from Mailman import Utils
-from Mailman.i18n import _
+from Mailman.i18n import C_
def convert(mlist):
for attr in ('msg_header', 'msg_footer', 'digest_header', 'digest_footer',
@@ -35,10 +35,10 @@
t = Utils.to_dollar(s)
setattr(mlist, attr, t)
mlist.use_dollar_strings = 1
- print _('Saving list')
+ print C_('Saving list')
mlist.Save()
if __name__ == '__main__':
- print _(__doc__.replace('%', '%%'))
+ print C_(__doc__.replace('%', '%%'))
diff -ruN mailman-2.1.12-a/bin/discard mailman-2.1.12-b/bin/discard
--- mailman-2.1.12-a/bin/discard 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/discard 2009-07-28 12:19:54.000000000 +0200
@@ -41,7 +41,7 @@
import paths
from Mailman import mm_cfg
from Mailman.MailList import MailList
-from Mailman.i18n import _
+from Mailman.i18n import C_
try:
True, False
@@ -58,7 +58,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__)
+ print >> fd, C_(__doc__)
if msg:
print >> fd, msg
sys.exit(code)
@@ -80,7 +80,7 @@
files = args
if not files:
- print _('Nothing to do.')
+ print C_('Nothing to do.')
# Mapping from listnames to sequence of request ids
discards = {}
@@ -91,13 +91,13 @@
basename = os.path.basename(f)
mo = cre.match(basename)
if not mo:
- print >> sys.stderr, _('Ignoring non-held message: %(f)s')
+ print >> sys.stderr, C_('Ignoring non-held message: %(f)s')
continue
listname, id = mo.group('listname', 'id')
try:
id = int(id)
except (ValueError, TypeError):
- print >> sys.stderr, _('Ignoring held msg w/bad id: %(f)s')
+ print >> sys.stderr, C_('Ignoring held msg w/bad id: %(f)s')
continue
discards.setdefault(listname, []).append(id)
@@ -109,7 +109,7 @@
# No comment, no preserve, no forward, no forwarding address
mlist.HandleRequest(id, mm_cfg.DISCARD, '', False, False, '')
if not quiet:
- print _('Discarded held msg #%(id)s for list %(listname)s')
+ print C_('Discarded held msg #%(id)s for list %(listname)s')
mlist.Save()
finally:
mlist.Unlock()
diff -ruN mailman-2.1.12-a/bin/dumpdb mailman-2.1.12-b/bin/dumpdb
--- mailman-2.1.12-a/bin/dumpdb 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/dumpdb 2009-07-28 12:19:54.000000000 +0200
@@ -54,7 +54,7 @@
import paths
# Import this /after/ paths so that the sys.path is properly hacked
-from Mailman.i18n import _
+from Mailman.i18n import C_
PROGRAM = sys.argv[0]
COMMASPACE = ', '
@@ -72,7 +72,7 @@
fd = sys.stderr
else:
fd = sys.stdout
- print >> fd, _(__doc__) % globals()
+ print >> fd, C_(__doc__) % globals()
if msg:
print >> fd, msg
sys.exit(code)
@@ -102,10 +102,10 @@
doprint = False
if len(args) < 1:
- usage(1, _('No filename given.'))
+ usage(1, C_('No filename given.'))
elif len(args) > 1:
pargs = COMMASPACE.join(args)
- usage(1, _('Bad arguments: %(pargs)s'))
+ usage(1, C_('Bad arguments: %(pargs)s'))
else:
filename = args[0]
@@ -115,7 +115,7 @@
elif filename.endswith('.pck'):
filetype = 0
else:
- usage(1, _('Please specify either -p or -m.'))
+ usage(1, C_('Please specify either -p or -m.'))
# Handle dbs
pp = pprint.PrettyPrinter(indent=4)
@@ -130,16 +130,16 @@
try:
cnt = 1
if doprint:
- print _('[----- start %(typename)s file -----]')
+ print C_('[----- start %(typename)s file -----]')
while True:
try:
obj = load(fp)
except EOFError:
if doprint:
- print _('[----- end %(typename)s file -----]')
+ print C_('[----- end %(typename)s file -----]')
break
if doprint:
- print _('<----- start object %(cnt)s ----->')
+ print C_('<----- start object %(cnt)s ----->')
if isinstance(obj, StringType):
print obj
else:
diff -ruN mailman-2.1.12-a/bin/find_member mailman-2.1.12-b/bin/find_member
--- mailman-2.1.12-a/bin/find_member 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/find_member 2009-07-28 12:19:54.000000000 +0200
@@ -64,7 +64,7 @@
from Mailman import Utils
from Mailman import MailList
from Mailman import Errors
-from Mailman.i18n import _
+from Mailman.i18n import C_
AS_MEMBER = 0x01
AS_OWNER = 0x02
@@ -94,7 +94,7 @@
try:
mlist = MailList.MailList(listname, lock=0)
except Errors.MMListError:
- print _('No such list: %(listname)s')
+ print C_('No such list: %(listname)s')
continue
if options.owners:
owners = mlist.owner
@@ -156,12 +156,12 @@
pass
if not args:
- usage(1, _('Search regular expression required'))
+ usage(1, C_('Search regular expression required'))
options.regexps = args
if not options.listnames:
- print _('No lists to search')
+ print C_('No lists to search')
return
matches = scanlists(options)
@@ -170,13 +170,13 @@
for k in addrs:
hits = matches[k]
lists = hits.keys()
- print k, _('found in:')
+ print k, C_('found in:')
for name in lists:
aswhat = hits[name]
if aswhat & AS_MEMBER:
print ' ', name
if aswhat & AS_OWNER:
- print ' ', name, _('(as owner)')
+ print ' ', name, C_('(as owner)')
diff -ruN mailman-2.1.12-a/bin/fix_url.py mailman-2.1.12-b/bin/fix_url.py
--- mailman-2.1.12-a/bin/fix_url.py 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12-b/bin/fix_url.py 2009-07-28 12:19:54.000000000 +0200
@@ -43,12 +43,12 @@
import paths
from Mailman import mm_cfg
-from Mailman.i18n import _
+from Mailman.i18n import C_