Mark Sapiro wrote:
>
>You can do this with a withlist script such as the set_topics.py.txt
>script attached. You would save this in Mailman's bin/ directory as
>set_topics.py and run it via
>
> bin/withlist -l -r set_topics <list> <user-email> [<topic> ...]'
Sorry, I forgot the attachment. Here it is.
--
Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
import sys
def set_topics(mlist, *args):
if len(args) < 1:
print >>sys.stderr, 'Usage: withlist -l -r set_topics <list>
<user-email> [<topic> ...]'
sys.exit(1)
member = args[0]
if not mlist.isMember(member):
print >>sys.stderr, 'Not a member: %s' % member
sys.exit(1)
topic_list = []
for topic in args[1:]:
valid = False
for name, pattern, desc, emptyflag in mlist.topics:
if topic == name:
valid = True
break
if valid:
topic_list.append(topic)
else:
print 'Ignored invalid topic: %s' % topic
mlist.setMemberTopics(member, topic_list)
mlist.Save()
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
Security Policy:
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp