summaryrefslogtreecommitdiffstats
path: root/Lib/htmllib.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 08:25:29 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 08:25:29 (GMT)
commit373c55e510f91fe2031bfb91e72fbf5d81c3915f (patch)
tree0ae98db0b1d2adfd2a249df6130332bb1426e82e /Lib/htmllib.py
parent9b93c5f248f9c1cab891dd58d519425ec9f838bd (diff)
downloadcpython-373c55e510f91fe2031bfb91e72fbf5d81c3915f.zip
cpython-373c55e510f91fe2031bfb91e72fbf5d81c3915f.tar.gz
cpython-373c55e510f91fe2031bfb91e72fbf5d81c3915f.tar.bz2
String method conversion.
Diffstat (limited to 'Lib/htmllib.py')
-rw-r--r--Lib/htmllib.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/htmllib.py b/Lib/htmllib.py
index d3e8f88..73af9f6 100644
--- a/Lib/htmllib.py
+++ b/Lib/htmllib.py
@@ -5,7 +5,6 @@ http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
-import string
from sgmllib import SGMLParser
from formatter import AS_IS
@@ -50,7 +49,7 @@ class HTMLParser(SGMLParser):
data = self.savedata
self.savedata = None
if not self.nofill:
- data = string.join(string.split(data))
+ data = ' '.join(data.split())
return data
# --- Hooks for anchors; should probably be overridden
@@ -321,13 +320,13 @@ class HTMLParser(SGMLParser):
name = ''
type = ''
for attrname, value in attrs:
- value = string.strip(value)
+ value = value.strip()
if attrname == 'href':
href = value
if attrname == 'name':
name = value
if attrname == 'type':
- type = string.lower(value)
+ type = value.lower()
self.anchor_bgn(href, name, type)
def end_a(self):
@@ -362,10 +361,10 @@ class HTMLParser(SGMLParser):
if attrname == 'src':
src = value
if attrname == 'width':
- try: width = string.atoi(value)
+ try: width = int(value)
except: pass
if attrname == 'height':
- try: height = string.atoi(value)
+ try: height = int(value)
except: pass
self.handle_image(src, alt, ismap, align, width, height)