diff options
| author | bwarsaw | 1999-11-12 17:29:52 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-11-12 17:29:52 +0000 |
| commit | ddf6a8d78ee182fff01a82b288ac6e570c29e7f3 (patch) | |
| tree | ef784ada52ccb5af1a7e2897c8d43f057b76ad5b | |
| parent | 9e0c290cb73a7f9e34e077a5654ed3f4a3ed077c (diff) | |
| download | mailman-ddf6a8d78ee182fff01a82b288ac6e570c29e7f3.tar.gz mailman-ddf6a8d78ee182fff01a82b288ac6e570c29e7f3.tar.zst mailman-ddf6a8d78ee182fff01a82b288ac6e570c29e7f3.zip | |
Simple move_list script (really just reassigns the list-specific
archive attributes).
| -rw-r--r-- | bin/move_list | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/bin/move_list b/bin/move_list new file mode 100644 index 000000000..9d21099f2 --- /dev/null +++ b/bin/move_list @@ -0,0 +1,66 @@ +#! /usr/bin/env python +# +# Copyright (C) 1998 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +"""Move a list to a new directory. + +What this really does is just update the three archive list attributes +public_archive_file_dir, private_archive_file_dir, and archive_directory by +recalculating them based on the new Defaults. It then saves the list. + +Usage: + move_list listname + +""" + +import os +import sys +import paths +from Mailman import MailList +from Mailman import mm_cfg + + + +def usage(code, msg=''): + print __doc__ + if msg: + print msg + sys.exit(code) + + + +def main(): + try: + mlist = MailList.MailList(sys.argv[1]) + except IndexError: + usage(1, 'You must supply a list name.') + try: + mlist.public_archive_file_dir = mm_cfg.PUBLIC_ARCHIVE_FILE_DIR + mlist.private_archive_file_dir = os.path.join( + mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, + mlist._internal_name + '.mbox') + mlist.archive_directory = os.path.join( + mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, + mlist._internal_name) + finally: + mlist.Save() + mlist.Unlock() + + + +if __name__ == '__main__': + main() |
