summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/remove.rst
diff options
context:
space:
mode:
authorBarry Warsaw2017-07-22 03:02:05 +0000
committerBarry Warsaw2017-07-22 03:02:05 +0000
commitf00b94f18e1d82d1488cbcee6053f03423bc2f49 (patch)
tree1a8e56dff0eab71e58e5fc9ecc5f3c614d7edca7 /src/mailman/commands/docs/remove.rst
parentf54c045519300f6f70947d1114f46c2b8ae0d368 (diff)
downloadmailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.tar.gz
mailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.tar.zst
mailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.zip
Diffstat (limited to 'src/mailman/commands/docs/remove.rst')
-rw-r--r--src/mailman/commands/docs/remove.rst33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/mailman/commands/docs/remove.rst b/src/mailman/commands/docs/remove.rst
index c534741f3..f13d8cacd 100644
--- a/src/mailman/commands/docs/remove.rst
+++ b/src/mailman/commands/docs/remove.rst
@@ -5,37 +5,26 @@ Command line list removal
A system administrator can remove mailing lists by the command line.
::
- >>> create_list('test@example.com')
- <mailing list "test@example.com" at ...>
+ >>> create_list('ant@example.com')
+ <mailing list "ant@example.com" at ...>
+
+ >>> command = cli('mailman.commands.cli_lists.remove')
+ >>> command('mailman remove ant@example.com')
+ Removed list: ant@example.com
>>> from mailman.interfaces.listmanager import IListManager
>>> from zope.component import getUtility
>>> list_manager = getUtility(IListManager)
- >>> 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
-
- >>> print(list_manager.get('test@example.com'))
+ >>> print(list_manager.get('ant@example.com'))
None
You can also remove lists quietly.
::
- >>> create_list('test@example.com')
- <mailing list "test@example.com" at ...>
+ >>> create_list('ant@example.com')
+ <mailing list "ant@example.com" at ...>
- >>> args.quiet = True
- >>> command.process(args)
+ >>> command('mailman remove ant@example.com --quiet')
- >>> print(list_manager.get('test@example.com'))
+ >>> print(list_manager.get('ant@example.com'))
None