From 3de50ee34a0ce58a0b9017b4d482c90ff6a97b00 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Thu, 1 Mar 2012 20:40:25 +0100 Subject: Add commandline options to list (non-) moderated list members --- bin/list_members | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'bin') 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 -- cgit v1.2.3 From 4cc8bddc00dc5cb2e333f5eea41ba7916dfd52a1 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Thu, 1 Mar 2012 20:49:58 +0100 Subject: Consistently use "non moderated" instead of "not moderated" --- bin/list_members | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/list_members b/bin/list_members index 3d6c0e09..c50cc06c 100755 --- a/bin/list_members +++ b/bin/list_members @@ -32,7 +32,7 @@ Where: --moderated / -m Print just the moderated members. - --not-moderated / -M + --non-moderated / -M Print just the non-moderated members. --digest[=kind] / -d [kind] @@ -161,7 +161,7 @@ def main(): invalidonly = False unicodeonly = False moderatedonly = False - notmoderatedonly = False + nonmoderatedonly = False # Throw away the first (program) argument args = sys.argv[1:] @@ -184,7 +184,7 @@ def main(): elif opt in ('-m', '--moderated'): moderatedonly = True elif opt in ('-M', '--non-moderated'): - notmoderatedonly = True + nonmoderatedonly = True elif opt in ('-o', '--output'): try: outfile = args.pop(0) @@ -253,7 +253,7 @@ def main(): rmembers = mlist.getMemberCPAddresses(rmembers) dmembers = mlist.getMemberCPAddresses(dmembers) - if invalidonly or unicodeonly or moderatedonly or notmoderatedonly: + if invalidonly or unicodeonly or moderatedonly or nonmoderatedonly: all = rmembers + dmembers all.sort() for addr in all: @@ -265,7 +265,7 @@ def main(): showit = True if moderatedonly and mlist.getMemberOption(addr, mm_cfg.Moderate): showit = True - if notmoderatedonly and not mlist.getMemberOption(addr, mm_cfg.Moderate): + if nonmoderatedonly and not mlist.getMemberOption(addr, mm_cfg.Moderate): showit = True if showit: print >> fp, formataddr((safe(name), addr)) -- cgit v1.2.3 From c153b143c64139a57c6e4febe233bece9d4a48ce Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Thu, 1 Mar 2012 21:04:45 +0100 Subject: list_members Usage: Keep regular/digest and moderated/non-moderated options together --- bin/list_members | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/list_members b/bin/list_members index c50cc06c..d7cf9329 100755 --- a/bin/list_members +++ b/bin/list_members @@ -29,17 +29,17 @@ Where: --regular / -r Print just the regular (non-digest) 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 + digest. + --moderated / -m Print just the moderated members. --non-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 - digest. - --nomail[=why] / -n [why] Print the members that have delivery disabled. Optional argument can be "byadmin", "byuser", "bybounce", or "unknown" which prints just the -- cgit v1.2.3