Command line list display¶
A system administrator can display all the mailing lists via the command line. When there are no mailing lists, a helpful message is displayed.
>>> command = cli('mailman.commands.cli_lists.lists') >>> command('mailman lists') No matching mailing lists found
When there are a few mailing lists, they are shown in alphabetical order by their fully qualified list names, with a description.
>>> from mailman.interfaces.domain import IDomainManager >>> from zope.component import getUtility >>> getUtility(IDomainManager).add('example.net') <Domain example.net...> >>> mlist_1 = create_list('[email protected]') >>> mlist_1.description = 'List One' >>> mlist_2 = create_list('[email protected]') >>> mlist_2.description = 'List Two' >>> mlist_3 = create_list('[email protected]') >>> mlist_3.description = 'List One in Example.Net' >>> command('mailman lists') 3 matching mailing lists found: [email protected] [email protected] [email protected]
You can display the mailing list names with their posting addresses, using the
You can also display the mailing list descriptions, using the
Maybe you want the descriptions but not the names.
There’s also a
--quiet/-q switch which reduces the verbosity a bit.
You can narrow the search down to a specific domain with the –domain option. A helpful message is displayed if no matching domains are given.
>>> command('mailman lists --domain example.org') No matching mailing lists found
But if a matching domain is given, only mailing lists in that domain are shown.
>>> command('mailman lists --domain example.net') 1 matching mailing lists found: [email protected]
More than one
--domain argument can be given; then all mailing lists in
matching domains are shown.
Mailing lists can be “advertised” meaning their existence is public knowledge. Non-advertised lists are considered private. Display through the command line can select on this attribute.