[Mailman-Developers] Request for template substitution token

Lindsay Haisley fmouse-mailman at fmp.com
Tue Oct 17 03:40:32 CEST 2006


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)     |


More information about the Mailman-Developers mailing list