# Copyright (C) 2016 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 # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. """Rebuild the archive TOC page for a list or lists. If you decide that the various archives/private//.txt.gz files are redundant and unnecessary and you stop running the cron/nightly_gzip job and remove all the *.txt.gz files, the archive TOC page(s) will still link to the now non-existant *.txt.gz files. This will eventually correct itself as new posts are archived, but if you want to do it faster, you can use this script. Save the script as bin/rebuild_archtoc.py Run it via bin/withlist -r rebuild_archtoc listname to do a single list or bin/withlist -r rebuild_archtoc -a to do all lists. """ from Mailman.Archiver.HyperArch import HyperArchive def rebuild_archtoc(mlist): arch = HyperArchive(mlist) arch.write_TOC()