diff options
| author | Barry Warsaw | 2009-08-21 18:07:35 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-08-21 18:07:35 -0400 |
| commit | d1718e1a1cc289344d2a68c7430c492a4a7966b6 (patch) | |
| tree | d6b404e8544c83de5a3516a8206c7da92d9d088f /src/mailman/docs/listmanager.txt | |
| parent | da566eb047608ed2e65c71dd25979f01c825c843 (diff) | |
| download | mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.tar.gz mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.tar.zst mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.zip | |
Test updates and repair.xo
Diffstat (limited to 'src/mailman/docs/listmanager.txt')
| -rw-r--r-- | src/mailman/docs/listmanager.txt | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mailman/docs/listmanager.txt b/src/mailman/docs/listmanager.txt index c432a8613..b366817c7 100644 --- a/src/mailman/docs/listmanager.txt +++ b/src/mailman/docs/listmanager.txt @@ -8,9 +8,7 @@ configuration variable MANAGERS_INIT_FUNCTION. The instance is accessible on the global config object. >>> from mailman.interfaces.listmanager import IListManager - >>> listmgr = config.db.list_manager - >>> IListManager.providedBy(listmgr) - True + >>> list_manager = IListManager(config) Creating a mailing list @@ -19,7 +17,7 @@ Creating a mailing list Creating the list returns the newly created IMailList object. >>> from mailman.interfaces.mailinglist import IMailingList - >>> mlist = listmgr.create('_xtest@example.com') + >>> mlist = list_manager.create('_xtest@example.com') >>> IMailingList.providedBy(mlist) True @@ -37,7 +35,7 @@ list to the system. If you try to create a mailing list with the same name as an existing list, you will get an exception. - >>> mlist_dup = listmgr.create('_xtest@example.com') + >>> mlist_dup = list_manager.create('_xtest@example.com') Traceback (most recent call last): ... ListAlreadyExistsError: _xtest@example.com @@ -48,13 +46,13 @@ Deleting a mailing list Use the list manager to delete a mailing list. - >>> listmgr.delete(mlist) - >>> sorted(listmgr.names) + >>> list_manager.delete(mlist) + >>> sorted(list_manager.names) [] After deleting the list, you can create it again. - >>> mlist = listmgr.create('_xtest@example.com') + >>> mlist = list_manager.create('_xtest@example.com') >>> print mlist.fqdn_listname _xtest@example.com @@ -65,13 +63,13 @@ Retrieving a mailing list When a mailing list exists, you can ask the list manager for it and you will always get the same object back. - >>> mlist_2 = listmgr.get('_xtest@example.com') + >>> mlist_2 = list_manager.get('_xtest@example.com') >>> mlist_2 is mlist True If you try to get a list that doesn't existing yet, you get None. - >>> print listmgr.get('_xtest_2@example.com') + >>> print list_manager.get('_xtest_2@example.com') None @@ -81,9 +79,9 @@ Iterating over all mailing lists Once you've created a bunch of mailing lists, you can use the list manager to iterate over either the list objects, or the list names. - >>> mlist_3 = listmgr.create('_xtest_3@example.com') - >>> mlist_4 = listmgr.create('_xtest_4@example.com') - >>> sorted(listmgr.names) + >>> mlist_3 = list_manager.create('_xtest_3@example.com') + >>> mlist_4 = list_manager.create('_xtest_4@example.com') + >>> sorted(list_manager.names) [u'_xtest@example.com', u'_xtest_3@example.com', u'_xtest_4@example.com'] - >>> sorted(m.fqdn_listname for m in listmgr.mailing_lists) + >>> sorted(m.fqdn_listname for m in list_manager.mailing_lists) [u'_xtest@example.com', u'_xtest_3@example.com', u'_xtest_4@example.com'] |
