Merge lp:~xtaran/mailman/mailman-improvements into lp:mailman/2.1

Proposed by Axel Beckert
Status: Merged
Merge reported by: Mark Sapiro
Merged at revision: not available
Proposed branch: lp:~xtaran/mailman/mailman-improvements
Merge into: lp:mailman/2.1
Diff against target: 56 lines (+17/-1)
1 file modified
bin/list_members (+17/-1)
To merge this branch: bzr merge lp:~xtaran/mailman/mailman-improvements
Reviewer Review Type Date Requested Status
Mark Sapiro code Approve
Bernard (community) 24 / 7 Approve
Review via email: mp+95448@code.launchpad.net

Description of the change

Add two options named -m (--moderated) and -M (--non-moderated) to list_members to list either only moderated list members or only non-moderated list members.

To post a comment you must log in.
Revision history for this message
Bernard (unowned60) wrote :

Options name 24/7 single man, list members, thanks!

review: Needs Resubmitting (24 / 7)
Revision history for this message
Bernard (unowned60) wrote :

yes, a 24/7!

review: Approve (24 / 7)
Revision history for this message
Mark Sapiro (msapiro) wrote :

Somehow this fell into the cracks, but better late than never I suppose. Merged with a few tweaksfor MM 2.1.21.

review: Approve (code)
Revision history for this message
Axel Beckert (xtaran) wrote :

Thanks, appreciated!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/list_members'
2--- bin/list_members 2005-08-27 01:40:17 +0000
3+++ bin/list_members 2012-03-01 20:09:22 +0000
4@@ -34,6 +34,12 @@
5 "plain" which prints just the digest members receiving that kind of
6 digest.
7
8+ --moderated / -m
9+ Print just the moderated members.
10+
11+ --non-moderated / -M
12+ Print just the non-moderated members.
13+
14 --nomail[=why] / -n [why]
15 Print the members that have delivery disabled. Optional argument can
16 be "byadmin", "byuser", "bybounce", or "unknown" which prints just the
17@@ -154,6 +160,8 @@
18 fullnames = False
19 invalidonly = False
20 unicodeonly = False
21+ moderatedonly = False
22+ nonmoderatedonly = False
23
24 # Throw away the first (program) argument
25 args = sys.argv[1:]
26@@ -173,6 +181,10 @@
27 preserve = True
28 elif opt in ('-r', '--regular'):
29 regular = True
30+ elif opt in ('-m', '--moderated'):
31+ moderatedonly = True
32+ elif opt in ('-M', '--non-moderated'):
33+ nonmoderatedonly = True
34 elif opt in ('-o', '--output'):
35 try:
36 outfile = args.pop(0)
37@@ -241,7 +253,7 @@
38 rmembers = mlist.getMemberCPAddresses(rmembers)
39 dmembers = mlist.getMemberCPAddresses(dmembers)
40
41- if invalidonly or unicodeonly:
42+ if invalidonly or unicodeonly or moderatedonly or nonmoderatedonly:
43 all = rmembers + dmembers
44 all.sort()
45 for addr in all:
46@@ -251,6 +263,10 @@
47 showit = True
48 if unicodeonly and isunicode(addr):
49 showit = True
50+ if moderatedonly and mlist.getMemberOption(addr, mm_cfg.Moderate):
51+ showit = True
52+ if nonmoderatedonly and not mlist.getMemberOption(addr, mm_cfg.Moderate):
53+ showit = True
54 if showit:
55 print >> fp, formataddr((safe(name), addr))
56 return