[Nym3-commit] r256 - trunk/nym3
jr at conuropsis.org
jr at conuropsis.org
Thu May 12 00:47:15 CEST 2005
Author: jr
Date: 2005-05-12 00:47:13 +0200 (Thu, 12 May 2005)
New Revision: 256
Modified:
trunk/nym3/Mail.py
Log:
-add a sequence number in the synopses
Modified: trunk/nym3/Mail.py
===================================================================
--- trunk/nym3/Mail.py 2005-05-08 13:29:47 UTC (rev 255)
+++ trunk/nym3/Mail.py 2005-05-11 22:47:13 UTC (rev 256)
@@ -44,9 +44,11 @@
oldestMid = chr(0) * midLen
"""Special value of a mid, older than any othany other mid"""
-def synopsize(msg):
+def synopsize(msg, seq):
"""Synopsizes a message : keeps a set of headers and the beginning of
- the body of the mail"""
+ the body of the mail
+ seq is the sequence number of the generated synopsis"""
+ #TODO assert type(seq) == int?
#TODO: this is not RFC2822-compliant
vheaders = [ 'Cc', 'From', 'Date', 'In-Reply-To', 'Sender',
'Message-Id', 'References', 'Return-Path', 'Subject',
@@ -63,9 +65,10 @@
a = re.search('^(' + i + ':.*)$', headers, re.M)
if a:
res = res + a.group(1)[0:80] + "\n" # TODO : append?
-
- return res + 'X-Octets: ' + repr(len(msg)) + "\n" + body
+ return res + 'X-Octets: ' + str(len(msg)) + "\n" +
+ 'X-Nym-Sequence: ' + str(seq) + "\n" + body
+
def syn_summary(synopsis):
"""returns a summary for the provided synopsis.
"""
More information about the Nym3-commit
mailing list