[Python-checkins] python/dist/src/Lib/email Header.py,1.17.6.3,1.17.6.4

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Mon, 03 Mar 2003 07:57:20 -0800


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

Modified Files:
      Tag: folding-reimpl-branch
	Header.py 
Log Message:
_split(): `first' is now guaranteed to be of the correct length so we
don't need to recursively split it.  We just wrap it in the
appropriate chrome, then add it to the recursively split remainder.


Index: Header.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v
retrieving revision 1.17.6.3
retrieving revision 1.17.6.4
diff -C2 -d -r1.17.6.3 -r1.17.6.4
*** Header.py	3 Mar 2003 06:59:14 -0000	1.17.6.3
--- Header.py	3 Mar 2003 15:57:17 -0000	1.17.6.4
***************
*** 302,308 ****
              # Binary search for split point
              first, last = _binsplit(splittable, charset, maxlinelen)
!         # Do the split
!         return self._split(first, charset, maxlinelen, splitchars) + \
!                self._split(last, charset, self._maxlinelen, splitchars)
  
      def _split_ascii(self, s, charset, firstlen, splitchars):
--- 302,311 ----
              # Binary search for split point
              first, last = _binsplit(splittable, charset, maxlinelen)
!         # first is of the proper length so just wrap it in the appropriate
!         # chrome.  last must be recursively split.
!         fsplittable = charset.to_splittable(first)
!         fencoded = charset.from_splittable(fsplittable, True)
!         chunk = [(fencoded, charset)]
!         return chunk + self._split(last, charset, self._maxlinelen, splitchars)
  
      def _split_ascii(self, s, charset, firstlen, splitchars):