[Spambayes-checkins] spambayes/scripts sb_unheader.py,1.2,1.3
Skip Montanaro
montanaro at users.sourceforge.net
Fri Mar 18 02:40:10 CET 2005
Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11642/scripts
Modified Files:
sb_unheader.py
Log Message:
Am I the only person who uses sb_unheader.py? ;-) I've had this change in
my sandbox for ages. I believe the Generator.Generator __call__ method is
either deprecated or gone altogether in favor of flatten.
Index: sb_unheader.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_unheader.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sb_unheader.py 21 Oct 2003 21:46:31 -0000 1.2
--- sb_unheader.py 18 Mar 2005 01:40:08 -0000 1.3
***************
*** 84,88 ****
for msg in mailbox.PortableUnixMailbox(f, Parser().parse):
process_message(msg, dosa, pats)
! gen(msg, unixfrom=1)
def process_maildir(d, dosa=1, pats=None):
--- 84,88 ----
for msg in mailbox.PortableUnixMailbox(f, Parser().parse):
process_message(msg, dosa, pats)
! gen.flatten(msg, unixfrom=1)
def process_maildir(d, dosa=1, pats=None):
***************
*** 97,101 ****
tmpfile = open(tmpfn, "w")
print "writing to %s" % tmpfn
! email.Generator.Generator(tmpfile, maxheaderlen=0)(msg, unixfrom=0)
os.rename(tmpfn, fn)
--- 97,102 ----
tmpfile = open(tmpfn, "w")
print "writing to %s" % tmpfn
! gen = email.Generator.Generator(tmpfile, maxheaderlen=0)
! gen.flatten(msg, unixfrom=0)
os.rename(tmpfn, fn)
More information about the Spambayes-checkins
mailing list