
I'm trying to write a script where I can change the default_member_moderation and accept-these_nonmembers objects, after a new Mailman list is created automatically by a cron process. I've been able to change the "default_member_moderation" as planned, but the "accept_these_nonmembers" object I'm having troubles with. When I try to add an email address, it shows up in the configuration like this: w e b @ i s u . e d u
How can I get the whole thing on one line. There's my python code
import sys #Run this script with #withlist -l -r change_values mylist # def change_values(mlist): print 'LIST ', mlist.internal_name() print ' Default Member Moderation Before: ', mlist.default_member_moderation print ' Accepted Non Members Before: ', mlist.accept_these_nonmembers mlist.default_member_moderation = 1 mlist.accept_these_nonmembers = "root@mm.isu.edu' print ' Default Member Moderation After: ', mlist.default_member_moderation print ' Accepted Non Members After: ', mlist.accept_these_nonmembers mlist.Save()
The reason why I'm doing this is these lists have a different configuration setup than what's in a default list that's setup with the standard configuration in mm_cfg.py
-- Kory Wheatley Academic Computing Analyst Sr. Phone 282-3874 ######################################### Everything must point to him.

On Sep 28, 2004, at 16:06, Kory Wheatley wrote:
mlist.accept_these_nonmembers = "root@mm.isu.edu'
This should probably be: mlist.accept_these_nonmembers = [ "root@mm.isu.edu" ] If you give a string to something that expects a list, it will often treat it as a 'list of single characters' rather than a 'list of strings'. -- ("`-/")_.-'"``-._ Chris Cogdon <chris@cogdon.org> . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL

On 29 Sep 2004, at 00:06, Kory Wheatley wrote:
accept_these_nonmembers is held as a Python list not a string. You may want to say:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
or, if you do not want to preserve the prior list content:
mlist.accept_these_nonmembers = ["root@mm.isu.edu"]
or, you want to add the address only if it is not already in the list:
if not "root@mm.isu.edu" in mlist.accept_these_nonmembers:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")

On 29 Sep 2004, at 00:06, Kory Wheatley wrote:
accept_these_nonmembers is held as a Python list not a string. You may want to say:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
or, if you do not want to preserve the prior list content:
mlist.accept_these_nonmembers = ["root@mm.isu.edu"]
or, you want to add the address only if it is not already in the list:
if not "root@mm.isu.edu" in mlist.accept_these_nonmembers:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
Mailman-Users mailing list Mailman-Users@python.org 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/

On Sep 28, 2004, at 16:06, Kory Wheatley wrote:
mlist.accept_these_nonmembers = "root@mm.isu.edu'
This should probably be: mlist.accept_these_nonmembers = [ "root@mm.isu.edu" ] If you give a string to something that expects a list, it will often treat it as a 'list of single characters' rather than a 'list of strings'. -- ("`-/")_.-'"``-._ Chris Cogdon <chris@cogdon.org> . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org 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/

On Sep 28, 2004, at 16:06, Kory Wheatley wrote:
mlist.accept_these_nonmembers = "root@mm.isu.edu'
This should probably be: mlist.accept_these_nonmembers = [ "root@mm.isu.edu" ] If you give a string to something that expects a list, it will often treat it as a 'list of single characters' rather than a 'list of strings'. -- ("`-/")_.-'"``-._ Chris Cogdon <chris@cogdon.org> . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL

On 29 Sep 2004, at 00:06, Kory Wheatley wrote:
accept_these_nonmembers is held as a Python list not a string. You may want to say:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
or, if you do not want to preserve the prior list content:
mlist.accept_these_nonmembers = ["root@mm.isu.edu"]
or, you want to add the address only if it is not already in the list:
if not "root@mm.isu.edu" in mlist.accept_these_nonmembers:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")

On 29 Sep 2004, at 00:06, Kory Wheatley wrote:
accept_these_nonmembers is held as a Python list not a string. You may want to say:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
or, if you do not want to preserve the prior list content:
mlist.accept_these_nonmembers = ["root@mm.isu.edu"]
or, you want to add the address only if it is not already in the list:
if not "root@mm.isu.edu" in mlist.accept_these_nonmembers:
mlist.accept_these_nonmembers.append("root@mm.isu.edu")
Mailman-Users mailing list Mailman-Users@python.org 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/

On Sep 28, 2004, at 16:06, Kory Wheatley wrote:
mlist.accept_these_nonmembers = "root@mm.isu.edu'
This should probably be: mlist.accept_these_nonmembers = [ "root@mm.isu.edu" ] If you give a string to something that expects a list, it will often treat it as a 'list of single characters' rather than a 'list of strings'. -- ("`-/")_.-'"``-._ Chris Cogdon <chris@cogdon.org> . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org 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/
participants (3)
-
Chris Cogdon
-
Kory Wheatley
-
Richard Barrett