diff options
| author | Barry Warsaw | 2007-08-05 22:49:04 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2007-08-05 22:49:04 -0500 |
| commit | 89bdaec5c735ffb2b27cc29620cb01b451b72550 (patch) | |
| tree | 61c6fa40eb1d3e267475430005b50ecf44b46512 /Mailman/bin/rmlist.py | |
| parent | e0abca9fbdde530f7517396677c87f19c86bc0c6 (diff) | |
| download | mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.gz mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.zst mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.zip | |
Diffstat (limited to 'Mailman/bin/rmlist.py')
| -rw-r--r-- | Mailman/bin/rmlist.py | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/Mailman/bin/rmlist.py b/Mailman/bin/rmlist.py index c51ab7fdf..e0be8f6f5 100644 --- a/Mailman/bin/rmlist.py +++ b/Mailman/bin/rmlist.py @@ -24,66 +24,13 @@ from Mailman import Errors from Mailman import Utils from Mailman import Version from Mailman.MailList import MailList +from Mailman.app.lifecycle import remove_list from Mailman.configuration import config from Mailman.i18n import _ from Mailman.initialize import initialize -__i18n_templates__ = True - - - -def remove_it(listname, filename, msg, quiet=False): - if os.path.islink(filename): - if not quiet: - print _('Removing $msg') - os.unlink(filename) - elif os.path.isdir(filename): - if not quiet: - print _('Removing $msg') - shutil.rmtree(filename) - elif os.path.isfile(filename): - os.unlink(filename) - else: - if not quiet: - print _('$listname $msg not found as $filename') - - -def delete_list(listname, mlist=None, archives=True, quiet=False): - removeables = [] - if mlist: - # Remove the list from the database - config.db.list_manager.delete(mlist) - # Do the MTA-specific list deletion tasks - if config.MTA: - modname = 'Mailman.MTA.' + config.MTA - __import__(modname) - sys.modules[modname].remove(mlist) - # Remove the list directory - removeables.append((os.path.join('lists', listname), _('list info'))) - - # Remove any stale locks associated with the list - for filename in os.listdir(config.LOCK_DIR): - fn_listname = filename.split('.')[0] - if fn_listname == listname: - removeables.append((os.path.join(config.LOCK_DIR, filename), - _('stale lock file'))) - - if archives: - removeables.extend([ - (os.path.join('archives', 'private', listname), - _('private archives')), - (os.path.join('archives', 'private', listname + '.mbox'), - _('private archives')), - (os.path.join('archives', 'public', listname), - _('public archives')), - (os.path.join('archives', 'public', listname + '.mbox'), - _('public archives')), - ]) - - for dirtmpl, msg in removeables: - path = os.path.join(config.VAR_DIR, dirtmpl) - remove_it(listname, path, msg, quiet) +__i18n_templates__ = True @@ -130,7 +77,7 @@ No such list: ${fqdn_listname}. Removing its residual archives.""") if not opts.archives: print _('Not removing archives. Reinvoke with -a to remove them.') - delete_list(fqdn_listname, mlist, opts.archives) + remove_list(fqdn_listname, mlist, opts.archives) config.db.flush() |
