[Python-checkins] CVS: python/dist/src/Lib htmllib.py,1.16,1.17

Eric S. Raymond esr@users.sourceforge.net
Fri, 09 Feb 2001 00:21:19 -0800


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

Modified Files:
	htmllib.py 
Log Message:
String method conversion.


Index: htmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/htmllib.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** htmllib.py	2001/01/23 15:35:05	1.16
--- htmllib.py	2001/02/09 08:21:17	1.17
***************
*** 6,10 ****
  
  
- import string
  from sgmllib import SGMLParser
  from formatter import AS_IS
--- 6,9 ----
***************
*** 51,55 ****
          self.savedata = None
          if not self.nofill:
!             data = string.join(string.split(data))
          return data
  
--- 50,54 ----
          self.savedata = None
          if not self.nofill:
!             data = ' '.join(data.split())
          return data
  
***************
*** 322,326 ****
          type = ''
          for attrname, value in attrs:
!             value = string.strip(value)
              if attrname == 'href':
                  href = value
--- 321,325 ----
          type = ''
          for attrname, value in attrs:
!             value = value.strip()
              if attrname == 'href':
                  href = value
***************
*** 328,332 ****
                  name = value
              if attrname == 'type':
!                 type = string.lower(value)
          self.anchor_bgn(href, name, type)
  
--- 327,331 ----
                  name = value
              if attrname == 'type':
!                 type = value.lower()
          self.anchor_bgn(href, name, type)
  
***************
*** 363,370 ****
                  src = value
              if attrname == 'width':
!                 try: width = string.atoi(value)
                  except: pass
              if attrname == 'height':
!                 try: height = string.atoi(value)
                  except: pass
          self.handle_image(src, alt, ismap, align, width, height)
--- 362,369 ----
                  src = value
              if attrname == 'width':
!                 try: width = int(value)
                  except: pass
              if attrname == 'height':
!                 try: height = int(value)
                  except: pass
          self.handle_image(src, alt, ismap, align, width, height)