diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2012-03-01 20:40:25 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2012-03-01 20:40:25 +0100 |
commit | 3de50ee34a0ce58a0b9017b4d482c90ff6a97b00 (patch) | |
tree | 53a68477e75fe4dca6da5398828da9f5713636ce /bin/list_members | |
parent | b3610954779fbd5a97876bebee4734829106537d (diff) | |
download | mailman2-3de50ee34a0ce58a0b9017b4d482c90ff6a97b00.tar.gz mailman2-3de50ee34a0ce58a0b9017b4d482c90ff6a97b00.tar.xz mailman2-3de50ee34a0ce58a0b9017b4d482c90ff6a97b00.zip |
Add commandline options to list (non-) moderated list members
Diffstat (limited to 'bin/list_members')
-rwxr-xr-x | bin/list_members | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/list_members b/bin/list_members index cb574081..3d6c0e09 100755 --- a/bin/list_members +++ b/bin/list_members @@ -29,6 +29,12 @@ Where: --regular / -r Print just the regular (non-digest) members. + --moderated / -m + Print just the moderated members. + + --not-moderated / -M + Print just the non-moderated members. + --digest[=kind] / -d [kind] Print just the digest members. Optional argument can be "mime" or "plain" which prints just the digest members receiving that kind of @@ -154,6 +160,8 @@ def main(): fullnames = False invalidonly = False unicodeonly = False + moderatedonly = False + notmoderatedonly = False # Throw away the first (program) argument args = sys.argv[1:] @@ -173,6 +181,10 @@ def main(): preserve = True elif opt in ('-r', '--regular'): regular = True + elif opt in ('-m', '--moderated'): + moderatedonly = True + elif opt in ('-M', '--non-moderated'): + notmoderatedonly = True elif opt in ('-o', '--output'): try: outfile = args.pop(0) @@ -241,7 +253,7 @@ def main(): rmembers = mlist.getMemberCPAddresses(rmembers) dmembers = mlist.getMemberCPAddresses(dmembers) - if invalidonly or unicodeonly: + if invalidonly or unicodeonly or moderatedonly or notmoderatedonly: all = rmembers + dmembers all.sort() for addr in all: @@ -251,6 +263,10 @@ def main(): showit = True if unicodeonly and isunicode(addr): showit = True + if moderatedonly and mlist.getMemberOption(addr, mm_cfg.Moderate): + showit = True + if notmoderatedonly and not mlist.getMemberOption(addr, mm_cfg.Moderate): + showit = True if showit: print >> fp, formataddr((safe(name), addr)) return |