[Mailman-Users] mm_cfg.py doesn't appear to be working

Richard Barrett R.Barrett at ftel.co.uk
Tue Aug 13 20:43:42 CEST 2002


At 10:56 13/08/2002 -0700, Timothy R. Robnett wrote:
>On Tue Aug 13, 2002 at 10:45:19AM -0700, Bob Weissman wrote:
> > At 10:20 AM 8/13/02, you wrote:
> > >I installed MM yesterday and got it working. However changes added to
> > >mm_cfg.py do not appear to have any effect. However if I break the rules
> > >and change Defaults.py it does have the desired effect. bin/check_perms
> > >reports that everything is fine.
> > >
> > >A search of the archives didn't yield any leads. Any other ideas? TIA
> >
> >
> > Did you make sure to put your changes AFTER the "from Defaults import 
> *" line in mm_cfg.py?
>
>Yes it does appear after the import line. Here is a cut from my mm_cfg.py
>
>****<snip from mm_cfg.py>****
>from Defaults import *
>
>##################################################
># Put YOUR site-specific settings below this line.
>DEFAULT_URL = 'https://www.robnett.net/mailman/'
>DEFAULT_MSG_FOOTER = """ """
>****<end of snip>****
>
>Any other thoughts?

A couple of thoughts:

1. Some list attributes are initially set from mm_cfg.py configuration 
variables ONLY when the list is created. Subsequent changes to those 
defaults aren't propagated automatically into these per list attributes. 
DEFAULT_URL is an example. However, a list's URL can be changed (carefully) 
through the web admin GUI with MM 2.0.x or with bin/fix_url.py with MM 2.1.

2. Some defaults (call them secondary) in Defaults.py are defined in terms 
of other defaults (call them primary) defined higher up the source of 
Defaults.py. If you change the value of a primary default in mm_cfg.py you 
will not automatically change the value of those secondary defaults that 
depended on that redefined primary default; by the time mm_cfg.py is being 
processed the value of the secondary defaults has already been assigned. 
You must also redefine those secondary defaults in mm_cfg.py below the 
redefinition of the primary they depended on; just copy the line that set 
the secondary default from Defaults.py to mm_cfg.py and when it is 
processed it will pick up the revised value it depends upon.

fyi: all the Mailman code imports mm_cfg.py which in turn imports 
Defaults.py. Hence the definitions in mm_cfg.py are evaluated following 
evaluation of Defaults. py. Values assigned in Defaults.py are re-evaluated 
after mm_cfg.py is processed by Python. If changing it in Defaults.py works 
and changing it in mm_cfg.py does not then I reckon you've got problem 2 above.





More information about the Mailman-Users mailing list