[Mailman-Developers] script to modify arbitrary value in config.db

John Wingenbach jwing@pliantsystems.com
Tue, 01 Feb 2000 15:14:55 -0500


I created the following python script to modify an arbitrary value
within the config.db file.  However, it seems to not correctly work.
 The value gets changed albeit it doesn't register correctly in the web.
 I admit to not being a python scripter. :-)  Where am I messed up?

TIA,
John

#! /usr/bin/env /share/bin/python

import marshal
import sys

def main(argv):

  file='/usr/local/mailman/lists/' + argv[1] + '/config.db'

  fp = open(file, 'r')
  dict = marshal.load(fp)
  fp.close();
  oldval = dict[argv[2]]
  dict[argv[2]] = argv[3]
  print argv[2], ' was: >', oldval, '< now is: >', dict[argv[2]], '<'
  fp = open(file, 'w')
  marshal.dump(dict, fp)
  fp.close();

if __name__ == "__main__":
  raise SystemExit(main(sys.argv))



--
John C. Wingenbach
Pliant Systems, Inc.
Sr. Systems Administrator
Work: (919) 405-4627
Fax:  (919) 405-4544