[Mailman-Users] Adding searching to index pages

Igor S. Livshits igorl at life.uiuc.edu
Sat Aug 21 00:34:23 CEST 1999


Hi,

Here's a short patch that will allow one to add a search block to the 
index.html pages created by the Mailman archiver:

-=>diff HyperArch.py HyperArch.py.orig
372d371
<      %(search)s
525,540d523
<
<         # Provision for archive searching
<         try:
<             search_file_path= os.path.join(mm_cfg.PREFIX,
<                                            'archives/private',
<                                            self.maillist._internal_name,
<                                            'search.html')
<             search= open(search_file_path, 'r')
<         except IOError:
<             d["search"] = '''\
<             <!-- searching disabled -->
<             '''
<         else:
<             d["search"] = search.read()
<             search.close()
<


Simply patch HyperArch.py and add a search.html file to your 
~mailman/archives/private/<listname>/ directory. As the archive gets 
rebuilt, the contents of the search.html file will get included just 
above the index table of the index.html file in that directory.

This provides a fairly painless way to add an interface for ht://Dig 
searches and similar.

This is my first attempt at Python code; so, if there is a better way 
to accomplish the same, I'd love to hear about it.

Enjoy, igor




More information about the Mailman-Users mailing list