summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2008-05-17 21:14:05 (GMT)
committerFred Drake <fdrake@acm.org>2008-05-17 21:14:05 (GMT)
commitcb51d84214ed07268338392abef986b9a56d0141 (patch)
tree474b5ec5794e8e97953df73059c55d78cc2df631 /Lib
parent91ae2502739ecfcc7a8a013473553224b8387521 (diff)
downloadcpython-cb51d84214ed07268338392abef986b9a56d0141.zip
cpython-cb51d84214ed07268338392abef986b9a56d0141.tar.gz
cpython-cb51d84214ed07268338392abef986b9a56d0141.tar.bz2
update references and documentation for modules in the new html package
(http://bugs.python.org/issue2882)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/html/parser.py11
-rw-r--r--Lib/htmllib.py2
-rw-r--r--Lib/test/test_codeccallbacks.py4
-rw-r--r--Lib/test/test_multibytecodec_support.py2
-rw-r--r--Lib/test/test_sundry.py2
5 files changed, 11 insertions, 10 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 2cbc2ec..b5010ac 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -372,16 +372,17 @@ class HTMLParser(markupbase.ParserBase):
c = int(s)
return unichr(c)
else:
- # Cannot use name2codepoint directly, because HTMLParser supports apos,
- # which is not part of HTML 4
- import htmlentitydefs
+ # Cannot use name2codepoint directly, because HTMLParser
+ # supports apos, which is not part of HTML 4
+ import html.entities
if HTMLParser.entitydefs is None:
entitydefs = HTMLParser.entitydefs = {'apos':u"'"}
- for k, v in htmlentitydefs.name2codepoint.iteritems():
+ for k, v in html.entities.name2codepoint.iteritems():
entitydefs[k] = unichr(v)
try:
return self.entitydefs[s]
except KeyError:
return '&'+s+';'
- return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s)
+ return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));",
+ replaceEntities, s)
diff --git a/Lib/htmllib.py b/Lib/htmllib.py
index 24a2e2f..7ebb622 100644
--- a/Lib/htmllib.py
+++ b/Lib/htmllib.py
@@ -24,7 +24,7 @@ class HTMLParser(sgmllib.SGMLParser):
"""
- from htmlentitydefs import entitydefs
+ from html.entities import entitydefs
def __init__(self, formatter, verbose=0):
"""Creates an instance of the HTMLParser class.
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py
index 656551d..a0fa343 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -1,5 +1,5 @@
import test.test_support, unittest
-import sys, codecs, htmlentitydefs, unicodedata
+import sys, codecs, html.entities, unicodedata
class PosReturn:
# this can be used for configurable callbacks
@@ -86,7 +86,7 @@ class CodecCallbackTest(unittest.TestCase):
l = []
for c in exc.object[exc.start:exc.end]:
try:
- l.append(u"&%s;" % htmlentitydefs.codepoint2name[ord(c)])
+ l.append(u"&%s;" % html.entities.codepoint2name[ord(c)])
except KeyError:
l.append(u"&#%d;" % ord(c))
return (u"".join(l), exc.end)
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
index 6055764..b9aa34b 100644
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -64,7 +64,7 @@ class TestBase:
if self.has_iso10646:
return
- from htmlentitydefs import codepoint2name
+ from html.entities import codepoint2name
def xmlcharnamereplace(exc):
if not isinstance(exc, UnicodeEncodeError):
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 404a405..c2fb66d 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -50,7 +50,7 @@ class TestUntestedModules(unittest.TestCase):
import encodings
import formatter
import getpass
- import htmlentitydefs
+ import html.entities
import ihooks
import imghdr
import imputil