From e1f35c47ec8e8450cb2fd6db346b6fe51b76c93c Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Wed, 2 Jan 2002 01:58:27 +0000 Subject: Add a hack, based on Marc MERLIN's patch that provides /something/ for the archive url before the first message has been posted to the list. InitVars(): Write an initial index.html file which just states that the archive is currently empty. Template comes from emptyarchive.html. --- Mailman/Archiver/Archiver.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Mailman/Archiver/Archiver.py b/Mailman/Archiver/Archiver.py index 6f5e24321..820167d81 100644 --- a/Mailman/Archiver/Archiver.py +++ b/Mailman/Archiver/Archiver.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000,2001 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -31,6 +31,7 @@ from cStringIO import StringIO from Mailman import mm_cfg from Mailman import Mailbox from Mailman import LockFile +from Mailman import Utils from Mailman.SafeDict import SafeDict from Mailman.Logging.Syslog import syslog from Mailman.i18n import _ @@ -89,9 +90,22 @@ class Archiver: omask = os.umask(0) try: try: + listname = self.internal_name(); os.mkdir(self.archive_dir()+'.mbox', 02775) + # We also create an empty pipermail archive directory + # (pipermail would create it, but in the meantime lists with + # no archives return errors when you browse the non existant + # archive dir). -- Marc + os.mkdir(self.archive_dir(), 02775) except OSError, e: if e.errno <> errno.EEXIST: raise + fp = open(os.path.join(self.archive_dir(), 'index.html'), 'w') + fp.write(Utils.maketext( + 'emptyarchive.html', + {'listname': self.real_name, + 'listinfo': self.GetScriptURL('listinfo', absolute=1), + }, mlist=self)) + fp.close() finally: os.umask(omask) -- cgit v1.3.1