summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/mailinglist.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-02-04 07:00:56 -0500
committerBarry Warsaw2009-02-04 07:00:56 -0500
commitb93b16bea10a1983bd784d56703518134f538d08 (patch)
tree14c0e17243908377f903eb7af73cdfff72ebf53c /src/mailman/interfaces/mailinglist.py
parentbbbe644f21ef956e0b94a2d7ba9dd73e97846e3d (diff)
downloadmailman-b93b16bea10a1983bd784d56703518134f538d08.tar.gz
mailman-b93b16bea10a1983bd784d56703518134f538d08.tar.zst
mailman-b93b16bea10a1983bd784d56703518134f538d08.zip
Massive digester rework.
This moves actual digest creation and sending into a new queue runner. That way, digest creation does not block the main incoming processor. Lots of code clean up and reorganization too, and many fixes. digest_last_sent_at: Make this a DateTime digest_size_threshold: Make this a Float digest_volume_frequency: Make this an Enum DigestFrequency: new enum Fix up IMailingList interface to reflect reality. In Runner base class, allow for msg.get_sender() to return a False value. If this happens (as it can with the empty marker messages used to signal the digester that there's work to do), just use the list's preferred language. Give the retry.py and incoming.py queue runner modules some proper epilogues. The EmptyingRunner (for testing) logs itself as the runner its wrapping. The digest file name now ends in .mmdf since that's the format we're using. Add 'create_list' to doctest globals. Add a Mailbox class to add support for the context manager protocol.
Diffstat (limited to 'src/mailman/interfaces/mailinglist.py')
-rw-r--r--src/mailman/interfaces/mailinglist.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py
index cd7b11d64..2885f60ab 100644
--- a/src/mailman/interfaces/mailinglist.py
+++ b/src/mailman/interfaces/mailinglist.py
@@ -21,6 +21,7 @@ from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
+ 'DigestFrequency',
'IMailingList',
'Personalization',
'ReplyToMunging',
@@ -42,7 +43,6 @@ class Personalization(Enum):
full = 2
-
class ReplyToMunging(Enum):
# The Reply-To header is passed through untouched
no_munging = 0
@@ -52,6 +52,14 @@ class ReplyToMunging(Enum):
explicit_header = 2
+class DigestFrequency(Enum):
+ yearly = 0
+ monthly = 1
+ quarterly = 2
+ weekly = 3
+ daily = 4
+
+
class IMailingList(Interface):
"""A mailing list."""
@@ -155,7 +163,7 @@ class IMailingList(Interface):
"""A monotonically increasing integer sequentially assigned to each
list posting.""")
- last_digest_date = Attribute(
+ digest_last_sent_at = Attribute(
"""The date and time a digest of this mailing list was last sent.""")
owners = Attribute(
@@ -197,27 +205,23 @@ class IMailingList(Interface):
role.
""")
- volume_number = Attribute(
+ volume = Attribute(
"""A monotonically increasing integer sequentially assigned to each
new digest volume. The volume number may be bumped either
automatically (i.e. on a defined schedule) or manually. When the
volume number is bumped, the digest number is always reset to 1.""")
- digest_number = Attribute(
+ next_digest_number = Attribute(
"""A sequence number for a specific digest in a given volume. When
the digest volume number is bumped, the digest number is reset to
1.""")
- def bump():
- """Bump the digest's volume number to the next integer in the
- sequence, and reset the digest number to 1.
- """
message_count = Attribute(
"""The number of messages in the digest currently being collected.""")
- digest_size = Attribute(
- """The approximate size in kilobytes of 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