diff options
| author | Barry Warsaw | 2009-08-14 20:39:43 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-08-14 20:39:43 -0400 |
| commit | 592f3d56d2fd87cf06fdeb2bb63907a82ec172b2 (patch) | |
| tree | 54a9722380c37780606331fd013f71a88236f380 /src/mailman/commands/docs | |
| parent | 7138f22968b5003982f8a5e26f139aa1e5db7735 (diff) | |
| download | mailman-592f3d56d2fd87cf06fdeb2bb63907a82ec172b2.tar.gz mailman-592f3d56d2fd87cf06fdeb2bb63907a82ec172b2.tar.zst mailman-592f3d56d2fd87cf06fdeb2bb63907a82ec172b2.zip | |
Add the 'mailman remove' command.
Diffstat (limited to 'src/mailman/commands/docs')
| -rw-r--r-- | src/mailman/commands/docs/create.txt | 2 | ||||
| -rw-r--r-- | src/mailman/commands/docs/remove.txt | 81 |
2 files changed, 82 insertions, 1 deletions
diff --git a/src/mailman/commands/docs/create.txt b/src/mailman/commands/docs/create.txt index a66e2ac4b..e882b7a77 100644 --- a/src/mailman/commands/docs/create.txt +++ b/src/mailman/commands/docs/create.txt @@ -2,7 +2,7 @@ Command line list creation ========================== -A system administrator can create mailing lists from the command line. +A system administrator can create mailing lists by the command line. >>> class FakeArgs: ... language = None diff --git a/src/mailman/commands/docs/remove.txt b/src/mailman/commands/docs/remove.txt new file mode 100644 index 000000000..be623ccf4 --- /dev/null +++ b/src/mailman/commands/docs/remove.txt @@ -0,0 +1,81 @@ +========================= +Command line list removal +========================= + +A system administrator can remove mailing lists by the command line. + + >>> from mailman.app.lifecycle import create_list + >>> create_list('test@example.com') + <mailing list "test@example.com" at ...> + + >>> config.db.list_manager.get('test@example.com') + <mailing list "test@example.com" at ...> + + >>> class FakeArgs: + ... quiet = False + ... archives = False + ... listname = ['test@example.com'] + >>> args = FakeArgs() + + >>> from mailman.commands.cli_lists import Remove + >>> command = Remove() + >>> command.process(args) + Removed list: test@example.com + Not removing archives. Reinvoke with -a to remove them. + + >>> print config.db.list_manager.get('test@example.com') + None + +You can also remove lists quietly. + + >>> from mailman.app.lifecycle import create_list + >>> create_list('test@example.com') + <mailing list "test@example.com" at ...> + + >>> args.quiet = True + >>> command.process(args) + + >>> print config.db.list_manager.get('test@example.com') + None + + +Removing archives +================= + +By default 'mailman remove' does not remove a mailing list's archives. + + >>> from mailman.app.lifecycle import create_list + >>> create_list('test@example.com') + <mailing list "test@example.com" at ...> + + # Fake an mbox file for the mailing list. + >>> import os + >>> def make_mbox(fqdn_listname): + ... mbox_dir = os.path.join( + ... config.PUBLIC_ARCHIVE_FILE_DIR, fqdn_listname + '.mbox') + ... os.makedirs(mbox_dir) + ... mbox_file = os.path.join(mbox_dir, fqdn_listname + '.mbox') + ... with open(mbox_file, 'w') as fp: + ... print >> fp, 'A message' + ... assert os.path.exists(mbox_file) + ... return mbox_file + + >>> mbox_file = make_mbox('test@example.com') + >>> args.quiet = False + >>> command.process(args) + Removed list: test@example.com + Not removing archives. Reinvoke with -a to remove them. + + >>> os.path.exists(mbox_file) + True + +Even if the mailing list has been deleted, you can still delete the archives +afterward. + + >>> args.archives = True + + >>> command.process(args) + No such list: test@example.com; removing residual archives. + + >>> os.path.exists(mbox_file) + False |
