spambayes/scripts sb_unheader.py,1.2,1.3

"Skip Montanaro" <[email protected]>
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.