summaryrefslogtreecommitdiff
path: root/src/mailman/model/listmanager.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/model/listmanager.py')
-rw-r--r--src/mailman/model/listmanager.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mailman/model/listmanager.py b/src/mailman/model/listmanager.py
index b8bfa85ee..1bb2366b5 100644
--- a/src/mailman/model/listmanager.py
+++ b/src/mailman/model/listmanager.py
@@ -59,6 +59,11 @@ class ListManager:
config.db.store.add(mlist)
return mlist
+ def new(self, fqdn_listname):
+ """See `IListManager."""
+ from mailman.app.lifecycle import create_list
+ return create_list(fqdn_listname)
+
def get(self, fqdn_listname):
"""See `IListManager`."""
listname, at, hostname = fqdn_listname.partition('@')
@@ -80,6 +85,11 @@ class ListManager:
for fqdn_listname in self.names:
yield self.get(fqdn_listname)
+ def __iter__(self):
+ """See `IListManager`."""
+ for fqdn_listname in self.names:
+ yield self.get(fqdn_listname)
+
@property
def names(self):
"""See `IListManager`."""
@@ -90,8 +100,3 @@ class ListManager:
"""See `IListManager`."""
# lazr.restful will not allow this to be a generator.
return list(self.mailing_lists)
-
- def new(self, fqdn_listname):
- """See `IListManager."""
- from mailman.app.lifecycle import create_list
- return create_list(fqdn_listname)