httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r489464 - /httpd/mod_mbox/trunk/scripts/site-index.py
Date Thu, 21 Dec 2006 21:19:20 GMT
Author: pquerna
Date: Thu Dec 21 13:19:19 2006
New Revision: 489464

URL: http://svn.apache.org/viewvc?view=rev&rev=489464
Log:
Add a dumb python script to generate an html index, but groups lists by TLP, rather than just
alphabetical order.

Added:
    httpd/mod_mbox/trunk/scripts/site-index.py

Added: httpd/mod_mbox/trunk/scripts/site-index.py
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/scripts/site-index.py?view=auto&rev=489464
==============================================================================
--- httpd/mod_mbox/trunk/scripts/site-index.py (added)
+++ httpd/mod_mbox/trunk/scripts/site-index.py Thu Dec 21 13:19:19 2006
@@ -0,0 +1,51 @@
+#!/usr/local/bin/python
+
+import os
+import sys
+
+ROOT="/x1/mail-archives/mod_mbox"
+
+tlps={}
+
+for files in os.listdir(ROOT):
+    path = files
+    tlp = path[0:path.find('-')]
+    list = path[path.find('-')+1:]
+    # print "%s - %s %s" % (tlp, list, path)
+    if not os.access("%s/%s/listinfo.db.dir" % (ROOT, path), os.F_OK):
+        continue
+    if not tlps.has_key(tlp):
+        tlps[tlp] = {}
+    tlps[tlp][list] = path
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <title>Available Mailing Lists</title>
+</head>
+<!-- Background white, links blue (unvisited), navy (visited), red
+(active) -->
+ <body
+  bgcolor="#FFFFFF" text="#000000" link="#0000FF"
+  vlink="#000080" alink="#FF0000">
+<h2>Welcome to the mail archives on mail-archives.apache.org.</h2>
+<ul>
+"""
+keys = tlps.keys()
+keys.sort()
+for tlp in keys:
+    print "<li><h3><a name='%s'>%s.apache.org lists:</a></h3>"
% (tlp, tlp)
+    print "<ul>"
+    klist = tlps[tlp].keys()
+    klist.sort()
+    for list in klist:
+        print "    <li><a href='%s/'>%s@%s.apache.org</a></li>" %
(tlps[tlp][list], list, tlp)
+    print "</ul></li>"
+
+print """
+</ul>
+</body>
+</html>
+"""



Mime
View raw message