Re: [Mailman-Developers] a template arrrgh....
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). =) ___ Mailman-Developers mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-developers
Re: [Mailman-Developers] a template arrrgh....
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=detailaid=730769group_id=103atid=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
Re: [Mailman-Developers] a template arrrgh....
On July 31, 2003 01:58 pm, you wrote: 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=detailaid=730769group_id=103atid=100103 Hello Richard. Thanks for the tip but now I have a new problem (ain't that always the case). =) I tried installing the patch but it seemed to have messed up the template parsing (I was suddenly left with unparsed tags such as %(meta)s everywhere. I quickly reverted back to the unmodified code but now it appears that this data has been physically cached somewhere so now I have the problem of not being able to clear out the stale cache. Any idea where this cache is stored? My archives will shortly be useless if I cannot catch this quickly (and a rebuild is nasty, nasty as this is a busy server). Arrrgh. =) Cheers ___ Mailman-Developers mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-developers
Re: [Mailman-Developers] a template arrrgh....
On Thursday, July 31, 2003, at 10:37 pm, Ron Brogden wrote: On July 31, 2003 01:58 pm, you wrote: 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=detailaid=730769group_id=103atid=100103 Hello Richard. Thanks for the tip but now I have a new problem (ain't that always the case). =) I tried installing the patch but it seemed to have messed up the template parsing (I was suddenly left with unparsed tags such as %(meta)s everywhere. I quickly reverted back to the unmodified code but now it appears that this data has been physically cached somewhere so now I have the problem of not being able to clear out the stale cache. Any idea where this cache is stored? My archives will shortly be useless if I cannot catch this quickly (and a rebuild is nasty, nasty as this is a busy server). mailmanctl restart after making the code change. The cache is in process memory and is freshly created on demand within each process each time the mailman daemons or scripts are started. You will also need to rebuild existing mail archives using bin/arch to get the revised templates to affect existing HTML archive pages. Arrrgh. =) Cheers ___ Mailman-Developers mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-developers