Request for template substitution token
I'm working on some utilities to integrate the Namazu search engine with Mailman, along the lines of Tom Morrison's very nice instruction posted at http://mail.python.org/pipermail/mailman-users/2004-June/037580.html. The integration on the Namazu side is pretty straightforward and I've already written a piece that customizes Namazu templates on a per-list basis with information from Mailman's MailList module. See nmzproc at <http://www.fmp.com/namazu>. There's only one thing holding up the train on the Mailman end, and that's the fact that the only substitution token available in archtoc.html and archtocnombox.html is %(listname)s, which is replaced with the lists real_name, including any capitalization which the list admin may chose to use in the "pretty" name for the list. The Mailman templates need to be modified to generate a small search form, as per Tom Morrison's instructions, and the action attribute of the form needs to be a full path to a directory containing Namazu components, e.g. action="/mailman/%(listname)s/namazu.cgi". If Namazu is set up for a list, and the list admin decides he wants to change the real_name for the list to display all in caps, the link to Namazu will break. One line of code would do this: --- HyperArch.py.orig 2006-10-16 20:25:22.000000000 -0500 +++ HyperArch.py 2006-10-16 20:28:35.000000000 -0500 @@ -752,6 +752,7 @@ listname = mlist.internal_name() mbox = os.path.join(mlist.archive_dir()+'.mbox', listname+'.mbox') d = {"listname": mlist.real_name, + "internal": mlist.internal_name(), "listinfo": mlist.GetScriptURL('listinfo', absolute=1), "fullarch": '../%s.mbox/%s.mbox' % (listname, listname), "size": sizeof(mbox, mlist.preferred_language), This would give us a %(internal)s name for the list in the TOC index.html file which would be lower case and independent of administrative changes to the displayed list name. I can do this easily for myself (I've actually hacked PHP support into the TOC HTML files produced from these templates) but I'd like to put together and release a set of tools to integrate Namazu with Mailman. Telling people to use alternate Mailman templates, or giving them a patch for existing templates, is one thing. Telling them to patch the Mailman Archiver code is rather more radical, and if this small change could get the blessing of the Mailman developers going forward it would make my work on the Namazu integration stuff a lot easier. -- Lindsay Haisley | "Fighting against human | PGP public key FMP Computer Services | creativity is like | available at 512-259-1190 | trying to eradicate | <http://pubkeys.fmp.com> http://www.fmp.com | dandelions" | | (Pamela Jones) |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 16, 2006, at 9:40 PM, Lindsay Haisley wrote:
One line of code would do this:
--- HyperArch.py.orig 2006-10-16 20:25:22.000000000 -0500 +++ HyperArch.py 2006-10-16 20:28:35.000000000 -0500 @@ -752,6 +752,7 @@ listname = mlist.internal_name() mbox = os.path.join(mlist.archive_dir()+'.mbox', listname+'.mbox') d = {"listname": mlist.real_name, + "internal": mlist.internal_name(), "listinfo": mlist.GetScriptURL('listinfo', absolute=1), "fullarch": '../%s.mbox/%s.mbox' % (listname, listname), "size": sizeof(mbox, mlist.preferred_language),
This would give us a %(internal)s name for the list in the TOC index.html file which would be lower case and independent of administrative changes to the displayed list name.
+1 - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iQCVAwUBRTTHk3EjvBPtnXfVAQIDZQP/etwU9L80W+LuYR1ZEc81cYUe0bcDytoO MSyTYuFBpQeF4d0bRSxvSbofE6WJC3JuprDNRTmw615CxdcTO+00TincswSwz0f8 8TaTUBkQPLrYAbvoR5DmMgqi8rTebWAzSGp4WwTBQSrUGpPnwm1uTNTV8fzT8Lz0 y7m5YaMb1rs= =FOq/ -----END PGP SIGNATURE-----
participants (2)
-
Barry Warsaw
-
Lindsay Haisley