On Thursday, July 31, 2003, at 09:16 pm, Ron Brogden wrote:


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?


There is a known bug in MM 2.1.2 (and earlier 2.1.x) for which a patch is available. This patch has been folded into the CVS and should thus appear in the next release of MM (2.1.3?) but for the moment it is applicable to 2.1.2; see:


http://sourceforge.net/tracker/ index.php?func=detail&aid=730769&group_id=103&atid=100103

Cheers

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



They are formally closed by exdenting. Indentation is much cleaner than braces BEGIN/END etc, for indicating block structure, once you are used to it.


=)

---------------------------------------------------------------------
Richard Barrett                             http://www.openinfo.co.uk


_______________________________________________ Mailman-Developers mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-developers

Reply via email to