[Mailman-Developers] a template "arrrgh...."

Ron Brogden rb at islandnet.com
Thu Jul 31 14:16:21 EDT 2003


On July 30, 2003 06:11 pm, you wrote:
> Howdy.  I just upgraded to the latest 2.1.2 stable source (I had been
> running the last beta previously).  After upgrading, as expected all
> template files got stomped on so I set about recreating them as
> appropriate.  After doing so however I have two stumpers which looking at
> the source code for the archiver (and various other files), I am stumped to
> solve.

Howdy.  To follow up on my post, I noticed the following in Utils.py talking 
about how templates were looked for:

    # 1. the list-specific language directory
    #    lists/<listname>/<language>
    #
    # 2. the domain-specific language directory
    #    templates/<list.host_name>/<language>
    #
    # 3. the site-wide language directory
    #    templates/site/<language>
    #
    # 4. the global default language directory
    #    templates/<language>

Looking closer I see that some templates are used, some are not as the code 
base is still a tad inconsistent in that area.

"options.html" is not being used in most cases because the code simply does 
not call up a template.  "Cgi/options.py" only uses options.html in some 
cases (if you are not successful logging in, no template is used).   The 
latest version of Mailman re-breaks cookies in Konqueror (the beta had fixed 
this) so I was actually getting the error page and not immediately noticing 
that this is handled differently in the code.

So this is just a case of misleading behaviour / out of sync documentation I 
guess.  

Where I am still totally stumped though is for the archive templates.  I 
simply do not understand why the templates are being ignored.  Looking at 
HyperArch.py we have the following functions:

def quick_maketext(templatefile, dict=None, lang=None, mlist=None):

This seems to be where the templates are all parsed.  Looking through it I 
see the following:

template = _templatecache.get((templatefile, lang))
if template is None:
	# Use the basic maketext, with defaults to get the raw template	
	template = Utils.maketext(templatefile, lang=lang, raw=1)
	_templatecache[(templatefile, lang)] = template
 
So the first time through the template is loaded and from then on it sits in 
the global array _template.  The main thing here is that the maketext call 
should be returning an error if it cannot load the template (which has been 
edited) but instead it does not and the generated archive pages do not match 
the templates as stored in the templates folder.

Any ideas what gives here?  Why are my templates being ignored for the 
archives?

Cheers

PS: I hate the lack of formal closure for if statements in Python (yes, I do 
like idiot mittens thank you very much).

=)




More information about the Mailman-Developers mailing list