Quick script to update footers sitewide?
![](https://secure.gravatar.com/avatar/2206e8a0d58563f815a7568ea6675313.jpg?s=120&d=mm&r=g)
Anyone got a quick script handy I can use to update configuration data for all lists? I want to tweak my headers and footers. I know I want ot use with_list, but I've never done it.
Anyone got a script handy I can borrow/tweak and put on the FAQ?
![](https://secure.gravatar.com/avatar/a930430c7f9705b71a65f341c4191a2b.jpg?s=120&d=mm&r=g)
"CVR" == Chuq Von Rospach <chuqui@plaidworks.com> writes:
CVR> Anyone got a quick script handy I can use to update
CVR> configuration data for all lists? I want to tweak my headers
CVR> and footers. I know I want ot use with_list, but I've never
CVR> done it.
withlist is really mostly geared for operations on single lists (maybe it should be elaborated). But it's easy enough to write a one off.
Let's say you want to append "Chuq's List" to the end of every footer. Something like this ought to do it (untested -- and perhaps Py2.x and MM2.1-ish).
-------------------- snip snip --------------------bin/chuq.py import paths from Mailman import Utils from Mailman.MailList import MailList
for listname in Utils.list_names(): # Block until you acquire the list lock mlist = MailList(listname) try: mlist.msg_footer += "\nChuq's List" mlist.Save() finally: mlist.Unlock() -------------------- snip snip --------------------
% cd /path/to/mailman/install % python bin/chuq.py
Cook to taste. -Barry
participants (2)
-
barry@zope.com
-
Chuq Von Rospach