mod.py: query/set/reset moderation flag

Feb. 7, 2002
3:28 a.m.
Sometimes the web interface isn't what you're after. Here's a bin/withlist plugin:
# mod.py
from Mailman import mm_cfg import sys
def mod(list): for member in list.getMembers(): if list.getMemberOption(member, mm_cfg.Moderate): print member, "is moderated"
def set(list, member, value): value = not not (int(value)) if list.isMember(member): list.Lock() list.setMemberOption(member, mm_cfg.Moderate, value) print "%s's moderated flag set to %d" % (member, value) list.Save() list.Unlock() else: print member, "not a member"
Invoke with:
bin/withlist -r mod <list> to dump moderated membernames bin/withlist -r mod.set <list> <member> [0|1] to set moderation status
8417
Age (days ago)
8417
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dan Mick