diff options
| author | Barry Warsaw | 2009-02-22 21:33:17 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-02-22 21:33:17 -0500 |
| commit | 2d2d5393acc7db23baf4f3d43a0712bfa795c03e (patch) | |
| tree | f7a41025dde055777aa1b4dd900fad4fc96c3943 /src/mailman/interfaces | |
| parent | 8644b80168066c8fd11a7e2440ed8566453f0cd4 (diff) | |
| download | mailman-2d2d5393acc7db23baf4f3d43a0712bfa795c03e.tar.gz mailman-2d2d5393acc7db23baf4f3d43a0712bfa795c03e.tar.zst mailman-2d2d5393acc7db23baf4f3d43a0712bfa795c03e.zip | |
Get rid of one_last_digest. Move this into a separate OneLastDigest table.
Make it explicit to get the last digest (I could imagine an user selecting not
to). Actually add tests for this.
Start to get rid of 'from storm.locals import *' in favor of more specific
imports. Start to use Store.of() instead of config.db.store where we can.
Rework (delivery)MemberRosters to use the Member attributes. This ensures
that the layered lookup happens at the expense of query optimization.
Sundry and various cleanups.
Diffstat (limited to 'src/mailman/interfaces')
| -rw-r--r-- | src/mailman/interfaces/digests.py | 42 | ||||
| -rw-r--r-- | src/mailman/interfaces/mailinglist.py | 31 |
2 files changed, 60 insertions, 13 deletions
diff --git a/src/mailman/interfaces/digests.py b/src/mailman/interfaces/digests.py new file mode 100644 index 000000000..009be8e70 --- /dev/null +++ b/src/mailman/interfaces/digests.py @@ -0,0 +1,42 @@ +# Copyright (C) 2009 by the Free Software Foundation, Inc. +# +# This file is part of GNU Mailman. +# +# GNU Mailman is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. + +"""One last digest.""" + +from __future__ import absolute_import, unicode_literals + +__metaclass__ = type +__all__ = [ + 'IOneLastDigest' + ] + + +from zope.interface import Interface, Attribute + + + +class IOneLastDigest(Interface): + """Users who should receive one last digest.""" + + mailing_list = Attribute( + """The mailing list for the one last digest.""") + + address = Attribute( + """The address to receive the one last digest.""") + + delivery_mode = Attribute( + """The digest delivery mode to send.""") diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py index 2885f60ab..4e04fa39b 100644 --- a/src/mailman/interfaces/mailinglist.py +++ b/src/mailman/interfaces/mailinglist.py @@ -216,25 +216,30 @@ class IMailingList(Interface): the digest volume number is bumped, the digest number is reset to 1.""") - message_count = Attribute( - """The number of messages in the digest currently being collected.""") - digest_size_threshold = Attribute( """The maximum (approximate) size in kilobytes of the digest currently being collected.""") - messages = Attribute( - """An iterator over all the messages in the digest currently being - created. Returns individual IPostedMessage objects. - """) + def send_one_last_digest_to(address, delivery_mode): + """Make sure to send one last digest to an address. + + This is used when a person transitions from digest delivery to regular + delivery and wants to make sure they don't miss anything. By + indicating that they'd like to receive one last digest, they will + ensure continuity in receiving mailing lists posts. - limits = Attribute( - """An iterator over the IDigestLimiters associated with this digest. - Each limiter can make a determination of whether the digest has - reached the threshold for being automatically sent.""") + :param address: The address of the person receiving one last digest. + :type address: `IAddress` + :param delivery_mode: The type of digest to receive. + :type delivery_mode: `DeliveryMode` + """ + + last_digest_recipients = Attribute( + """An iterator over the addresses that should receive one last digest. - def send(): - """Send this digest now.""" + Items are 2-tuples of (`IAddress`, `DeliveryMode`). The one last + digest recipients are cleared. + """) decorators = Attribute( """An iterator over all the IDecorators associated with this digest. |
