summaryrefslogtreecommitdiff
path: root/Mailman/MailCommandHandler.py
diff options
context:
space:
mode:
authorcotton1998-11-19 13:15:09 +0000
committercotton1998-11-19 13:15:09 +0000
commitf54c2fd02ba71dabf16739806fa8f7bb6a2e2d55 (patch)
tree34f50499b9c48145fa17c70bfa474e4eede3ece2 /Mailman/MailCommandHandler.py
parentf5210e33e5929228a4f24e818e24f15c2dcde0a7 (diff)
downloadmailman-f54c2fd02ba71dabf16739806fa8f7bb6a2e2d55.tar.gz
mailman-f54c2fd02ba71dabf16739806fa8f7bb6a2e2d55.tar.zst
mailman-f54c2fd02ba71dabf16739806fa8f7bb6a2e2d55.zip
This change implements storing list members and digest members as
dicts instead of lists, which optimizes Utils.FindMatchingAddresses and general membership management, especially for large lists. MailList.py now supplies .GetMembers() and .GetDigestMembers() to supply the data in list form to anything that needs it that way. An new install showed this worked fine with some cursory testing of the cgi's and interactive poking around. A detailed listing of the changes follows: Mailman/Defaults.py.in: change data version to 11 Mailman/Digester.py: initvars now instantiates digest_members as {} instead of [] lines 113-114 and 121-122 now use del This change implements storing list members and digest members as dicts instead of lists, which optimizes Utils.FindMatchingAddresses and general membership management, especially for large lists. MailList.py now supplies .GetMembers() and .GetDigestMembers() to supply the data in list form to anything that needs it that way. Though INSTALL shows up on the changed files section, a diff a few seconds ago didn't show any differences in that file, so I hope nobody changed it in the interim. An new install showed this worked fine with some cursory testing of the cgi's and interactive poking around. A detailed listing of the changes follows: Mailman/Defaults.py.in: change data version to 11 Mailman/Digester.py: initvars now instantiates digest_members as {} instead of [] lines 113-114 and 121-122 now use del list.[digest_]member instead of list.[digest_]members.remove when figuring who to actually send digests to, use list.GetDigestMembers() instead of list.digest_members. Mailman/HTMLFormatter: now uses list.Get[Digest]Members to get subscribers, and length of digested subscribers and regular members MailCommandHandler, SecurityManager,Cgi/handle_opts, Cgi/options: all simple replacements of list.[digest_]members with list.Get[Digest]Members(). Mailman/Cgi/admin.py: mostly simple replacements of list.[digest_]members with the Get..() methods, however, the membership management section now works much quicker and changes digest->nodigest subscriptions via dictionary manipulations. Mailman/versions.py: updates lists to use dicts and changed list.[digest_]members to use the list.Get[Digest]Members() methods. Mailman/Utils.py: added a function "GetPossibleMatchingAddresses" which when fed an address, returns the list of addresses that "smart" address matching would match. changed FindMatchingAddresses(name, list) to use a new signature: FindMatchingAddresses(name, *dicts), where dicts is a list of dictionaries keyed by addresses. Just realized that this would better be FindMatchingAddresses(name, dict, *dicts) so that it enforces atleast 2 args... I'll make that change in a sec. All uses of FindMatchingAddresses have been changed to fit the new arguments. scott ----:**-F1 cvs30458aaa 1:12PM 0.98 Mail (Text Fill)--L59--32%------------------------------------------- ?
Diffstat (limited to 'Mailman/MailCommandHandler.py')
-rw-r--r--Mailman/MailCommandHandler.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py
index 7702eae82..f78eda456 100644
--- a/Mailman/MailCommandHandler.py
+++ b/Mailman/MailCommandHandler.py
@@ -358,25 +358,26 @@ class MailCommandHandler:
self.AddError("Private list: only members may see list "
"of subscribers.")
return
- if not len(self.digest_members) and not len(self.members):
+ digestmembers = self.GetDigestMembers()
+ members = self.GetMembers()
+ if not len(digestmembers) and not len(members):
self.AddToResponse("NO MEMBERS.")
return
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription):
return not s.GetUserOption(x, v)
- if len(self.digest_members):
+
+ if len(digestmembers):
self.AddToResponse("")
self.AddToResponse("Digest Members:")
- digestmembers = self.digest_members[:]
digestmembers.sort()
self.AddToResponse(string.join(map(AddTab,
filter(NotHidden,
digestmembers)),
"\n"))
- if len(self.members):
+ if len(members):
self.AddToResponse("Non-Digest Members:")
- members = self.members[:]
members.sort()
self.AddToResponse(string.join(map(AddTab,
filter(NotHidden, members)),