[Python-checkins] python/dist/src/Lib/email _compat22.py,1.4,1.5

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Mon, 10 Mar 2003 20:41:37 -0800


Update of /cvsroot/python/python/dist/src/Lib/email
In directory sc8-pr-cvs1:/tmp/cvs-serv30737

Modified Files:
	_compat22.py 
Log Message:
body_line_iterator(): Accept optional decode argument, pass through to
Message.get_payload().


Index: _compat22.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/_compat22.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** _compat22.py	10 Sep 2002 16:09:06 -0000	1.4
--- _compat22.py	11 Mar 2003 04:41:35 -0000	1.5
***************
*** 39,46 ****
  # These two functions are imported into the Iterators.py interface module.
  # The Python 2.2 version uses generators for efficiency.
! def body_line_iterator(msg):
!     """Iterate over the parts, returning string payloads line-by-line."""
      for subpart in msg.walk():
!         payload = subpart.get_payload()
          if _isstring(payload):
              for line in StringIO(payload):
--- 39,49 ----
  # These two functions are imported into the Iterators.py interface module.
  # The Python 2.2 version uses generators for efficiency.
! def body_line_iterator(msg, decode=False):
!     """Iterate over the parts, returning string payloads line-by-line.
! 
!     Optional decode (default False) is passed through to .get_payload().
!     """
      for subpart in msg.walk():
!         payload = subpart.get_payload(decode=decode)
          if _isstring(payload):
              for line in StringIO(payload):