diff -up mailman-2.1.29/bin/find_member.find-member-enhancements mailman-2.1.29/bin/find_member --- mailman-2.1.29/bin/find_member.find-member-moderators 2018-07-24 18:01:28.000000000 -0400 +++ mailman-2.1.29/bin/find_member 2021-10-05 18:34:28.072924537 -0400 @@ -34,6 +34,10 @@ Where: -w Search list owners as well as members. + --moderators + -m + Search list moderators as well as members. + --help -h Print this help message and exit. @@ -68,6 +72,7 @@ from Mailman.i18n import C_ AS_MEMBER = 0x01 AS_OWNER = 0x02 +AS_MODERATOR = 0x04 @@ -100,6 +105,10 @@ def scanlists(options): owners = mlist.owner else: owners = [] + if options.moderators: + moderators = mlist.moderator + else: + moderators = [] for cre in cres: for member in mlist.getMembers(): if cre.search(member): @@ -116,6 +125,13 @@ def scanlists(options): aswhat |= AS_OWNER entries[listname] = aswhat matches[owner] = entries + for moderator in moderators: + if cre.search(moderator): + entries = matches.get(moderator, {}) + aswhat = entries.get(listname, 0) + aswhat |= AS_MODERATOR + entries[listname] = aswhat + matches[moderator] = entries return matches @@ -123,13 +139,14 @@ def scanlists(options): class Options: listnames = Utils.list_names() owners = None + moderators = None def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'l:x:wh', + opts, args = getopt.getopt(sys.argv[1:], 'l:x:whm', ['listname=', 'exclude=', 'owners', - 'help']) + 'help', 'moderators']) except getopt.error, msg: usage(1, msg) @@ -148,6 +165,8 @@ def main(): excludes.append(arg.lower()) elif opt in ('-w', '--owners'): options.owners = 1 + elif opt in ('-m', '--moderators'): + options.moderators = 1 for ex in excludes: try: @@ -177,6 +196,8 @@ def main(): print ' ', name if aswhat & AS_OWNER: print ' ', name, C_('(as owner)') + if aswhat & AS_MODERATOR: + print ' ', name, C_('(as moderator)')