[Mailman-Users] Help me with a trivial withlist script

Bob Weissman rlw at rlw.best.vwh.net
Tue Jun 18 18:12:05 CEST 2002


There are times when I want to set an attribute on a whole bunch of mailing lists en masse. I tried to write a withlist script to do this, but it only works when the attribute value is a string. It doesn't work if the value is an integer. I'm no Python expert, but I thought from reading the docs that eval(`value`) would result in an expression of the correct type. No such luck.

To keep things simple, the script does only one list at a time, and I run it from a shell "for" loop.
def set_attr(mlist, attr, value): 
    setattr(mlist, attr, eval(`value`)) 
    mlist.Save()

What am I missing?

Thanks,
- Bob






More information about the Mailman-Users mailing list