~brad-allendev/mailman/cleanup

« back to all changes in this revision

Viewing changes to src/mailman/interfaces/mailinglist.py

  • Committer: Barry Warsaw
  • Date: 2009-02-23 02:33:17 UTC
  • Revision ID: barry@list.org-20090223023317-advf6dxjvo0m7u85
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        the digest volume number is bumped, the digest number is reset to
217
217
        1.""")
218
218
 
219
 
    message_count = Attribute(
220
 
        """The number of messages in the digest currently being collected.""")
221
 
 
222
219
    digest_size_threshold = Attribute(
223
220
        """The maximum (approximate) size in kilobytes of the digest currently
224
221
        being collected.""")
225
222
 
226
 
    messages = Attribute(
227
 
        """An iterator over all the messages in the digest currently being
228
 
        created.  Returns individual IPostedMessage objects.
 
223
    def send_one_last_digest_to(address, delivery_mode):
 
224
        """Make sure to send one last digest to an address.
 
225
 
 
226
        This is used when a person transitions from digest delivery to regular
 
227
        delivery and wants to make sure they don't miss anything.  By
 
228
        indicating that they'd like to receive one last digest, they will
 
229
        ensure continuity in receiving mailing lists posts.
 
230
 
 
231
        :param address: The address of the person receiving one last digest.
 
232
        :type address: `IAddress`
 
233
        :param delivery_mode: The type of digest to receive.
 
234
        :type delivery_mode: `DeliveryMode`
 
235
        """
 
236
 
 
237
    last_digest_recipients = Attribute(
 
238
        """An iterator over the addresses that should receive one last digest.
 
239
 
 
240
        Items are 2-tuples of (`IAddress`, `DeliveryMode`).  The one last
 
241
        digest recipients are cleared.
229
242
        """)
230
243
 
231
 
    limits = Attribute(
232
 
        """An iterator over the IDigestLimiters associated with this digest.
233
 
        Each limiter can make a determination of whether the digest has
234
 
        reached the threshold for being automatically sent.""")
235
 
 
236
 
    def send():
237
 
        """Send this digest now."""
238
 
 
239
244
    decorators = Attribute(
240
245
        """An iterator over all the IDecorators associated with this digest.
241
246
        When a digest is being sent, each decorator may modify the final