[mhonarc] show mailinglist info on archives



commit aaae1565f1520fb66f186f998fc03cc6208077b2
Author: Olav Vitters <olav vitters nl>
Date:   Wed Feb 13 00:11:05 2013 +0100

    show mailinglist info on archives

 archive.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/archive.py b/archive.py
index cbd753e..9ae1ba6 100755
--- a/archive.py
+++ b/archive.py
@@ -13,6 +13,9 @@ import email.utils
 import tempfile
 import shutil
 import subprocess
+
+sys.path.append('/usr/lib/mailman/bin')
+
 try:
         from cStringIO import StringIO
 except ImportError:
@@ -37,6 +40,16 @@ def human_size(size):
 
     return fmt % (size/float(lim/2**10), suf)
 
+def get_mailinglist_info(listname):
+    try:
+        import paths
+        from Mailman import MailList
+
+        mlist = MailList.MailList(n, lock=0)
+        return mlist.info
+    except:
+        return ""
+
 class Archiver:
     PUBLIC_ARCHIVE_DIR = "/var/lib/mailman/archives/public"
     PUBLIC_RCFILE = "/home/admin/mhonarc/public-rc/base.rc"
@@ -233,6 +246,9 @@ class Archiver:
                 dirs[a_dir] = a_dir
 
             with open(os.path.join(path, 'index.html'), 'w') as fp:
+                # Reshow general info
+                fp.write(get_mailinglist_info(listname))
+
                 # Overview per thread, date, author
                 for link in ("thread", "date", "author"):
                     fp.write('<h2>By %s</h2>' % link.title())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]