diff options
| author | Barry Warsaw | 2014-12-18 11:41:04 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2014-12-18 11:41:04 -0500 |
| commit | d53efd9675aba93ececf45952eb8df1286610e50 (patch) | |
| tree | 6d91d4ae49a77e492754844ba5a8d3fdf9c50ae1 /src | |
| parent | fd87e320611b8a91115f8fabd3583438627cdd92 (diff) | |
| download | mailman-d53efd9675aba93ececf45952eb8df1286610e50.tar.gz mailman-d53efd9675aba93ececf45952eb8df1286610e50.tar.zst mailman-d53efd9675aba93ececf45952eb8df1286610e50.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/handlers/docs/digests.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mailman/handlers/docs/digests.rst b/src/mailman/handlers/docs/digests.rst index ac6ea33d6..c3fc62ebf 100644 --- a/src/mailman/handlers/docs/digests.rst +++ b/src/mailman/handlers/docs/digests.rst @@ -82,11 +82,13 @@ actually crafted by the handler. >>> mlist.digest_size_threshold = 1 >>> mlist.volume = 2 >>> mlist.next_digest_number = 10 + >>> digest_path = os.path.join(mlist.data_path, 'digest.mmdf') >>> size = 0 >>> for msg in message_factory: ... process(mlist, msg, {}) - ... size += len(str(msg)) - ... if size >= mlist.digest_size_threshold * 1024: + ... # When the digest reaches the proper size, it is renamed. So we + ... # can break out of this list when the file disappears. + ... if not os.path.exists(digest_path): ... break >>> sum(1 for msg in digest_mbox(mlist)) |
