[Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.18,1.19

Guido van Rossum python-dev@python.org
Mon, 3 Apr 2000 23:31:41 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/Lib
In directory eric:/projects/python/develop/guido/src/Lib

Modified Files:
	mailbox.py 
Log Message:
Since Thomas Wouters kept complaining that he wants access to the the
Unix From lines, change the UnixMailbox class so that _search_start()
positions the file *before* the Unix From line instead of after it;
change _search_end() to skip one line before looking for the next From
line.  The rfc822.Message class automatically recognizes these Unix
From lines and squirrels them away in the 'unixfrom' instance variable.


Index: mailbox.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** mailbox.py	2000/02/10 17:17:13	1.18
--- mailbox.py	2000/04/04 03:31:39	1.19
***************
*** 98,108 ****
--- 98,111 ----
          def _search_start(self):
                  while 1:
+ 			pos = self.fp.tell()
                          line = self.fp.readline()
                          if not line:
                                  raise EOFError
                          if line[:5] == 'From ' and self._isrealfromline(line):
+ 				self.fp.seek(pos)
                                  return
  
          def _search_end(self):
+ 		self.fp.readline()	# Throw away header line
                  while 1:
                          pos = self.fp.tell()