[Python-checkins] python/dist/src/Lib/email Parser.py,1.14,1.15

barry@users.sourceforge.net barry@users.sourceforge.net
Sat, 28 Sep 2002 13:45:00 -0700


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

Modified Files:
	Parser.py 
Log Message:
Use True/False everywhere.


Index: Parser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Parser.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Parser.py	10 Sep 2002 16:14:56 -0000	1.14
--- Parser.py	28 Sep 2002 20:44:58 -0000	1.15
***************
*** 15,21 ****
  NL = '\n'
  
  
  class Parser:
!     def __init__(self, _class=Message.Message, strict=0):
          """Parser of RFC 2822 and MIME email messages.
  
--- 15,28 ----
  NL = '\n'
  
+ try:
+     True, False
+ except NameError:
+     True = 1
+     False = 0
+ 
+ 
  
  class Parser:
!     def __init__(self, _class=Message.Message, strict=False):
          """Parser of RFC 2822 and MIME email messages.
  
***************
*** 42,46 ****
          self._strict = strict
  
!     def parse(self, fp, headersonly=0):
          root = self._class()
          self._parseheaders(root, fp)
--- 49,53 ----
          self._strict = strict
  
!     def parse(self, fp, headersonly=False):
          root = self._class()
          self._parseheaders(root, fp)
***************
*** 49,53 ****
          return root
  
!     def parsestr(self, text, headersonly=0):
          return self.parse(StringIO(text), headersonly=headersonly)
  
--- 56,60 ----
          return root
  
!     def parsestr(self, text, headersonly=False):
          return self.parse(StringIO(text), headersonly=headersonly)
  
***************
*** 58,62 ****
          lastvalue = []
          lineno = 0
!         while 1:
              # Don't strip the line before we test for the end condition,
              # because whitespace-only header lines are RFC compliant
--- 65,69 ----
          lastvalue = []
          lineno = 0
!         while True:
              # Don't strip the line before we test for the end condition,
              # because whitespace-only header lines are RFC compliant
***************
*** 217,221 ****
              # separate Message object
              blocks = []
!             while 1:
                  blockmsg = self._class()
                  self._parseheaders(blockmsg, fp)
--- 224,228 ----
              # separate Message object
              blocks = []
!             while True:
                  blockmsg = self._class()
                  self._parseheaders(blockmsg, fp)