Setting configuration variables on all lists from command line
Hello,
could you provide an example how I can set various configuration variables using "mailman withlist" or "mailman "shell" on _all_ lists?
E.g. I want to set on all lists: m.send_welcome_message = 0 m.send_goodbye_message = 0
Thank you! P.M.
On 10/26/2017 08:00 AM, Peter Mueller wrote:
Hello,
could you provide an example how I can set various configuration variables using "mailman withlist" or "mailman "shell" on _all_ lists?
E.g. I want to set on all lists: m.send_welcome_message = 0 m.send_goodbye_message = 0
$ bin/mailman shell Welcome to the GNU Mailman shell
from zope.component import getUtility from mailman.interfaces.listmanager import IListManager listmanager = getUtility(IListManager) for mlist in listmanager.mailing_lists: ... print(mlist.list_name) ... mlist.send_welcome_message = False ... mlist.send_goodbye_message = False ... commit() ...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 10/26/2017 11:20 AM, Mark Sapiro wrote:
$ bin/mailman shell Welcome to the GNU Mailman shell
from zope.component import getUtility from mailman.interfaces.listmanager import IListManager
Actually, at least in the latest Mailman shell, the above two lines are not deeded as getUtility and the various interfaces are all in the initial namespace.
This should be enough
listmanager = getUtility(IListManager) for mlist in listmanager.mailing_lists: ... print(mlist.list_name) ... mlist.send_welcome_message = False ... mlist.send_goodbye_message = False ... commit() ...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro
-
Peter Mueller