# and CDATA (character data -- only end tags are special).
-import markupbase
+import _markupbase
import re
# Regular expressions used for parsing
return result
-class HTMLParser(markupbase.ParserBase):
+class HTMLParser(_markupbase.ParserBase):
"""Find tags and other markup and call handler functions.
Usage:
self.rawdata = ''
self.lasttag = '???'
self.interesting = interesting_normal
- markupbase.ParserBase.reset(self)
+ _markupbase.ParserBase.reset(self)
def feed(self, data):
"""Feed data to the parser.
def __init__(self):
if self.__class__ is ParserBase:
raise RuntimeError(
- "markupbase.ParserBase must be subclassed")
+ "_markupbase.ParserBase must be subclassed")
def error(self, message):
raise NotImplementedError(
# not supported at all.
-import markupbase
+import _markupbase
import re
__all__ = ["SGMLParser", "SGMLParseError"]
# chunks). Entity references are passed by calling
# self.handle_entityref() with the entity reference as argument.
-class SGMLParser(markupbase.ParserBase):
+class SGMLParser(_markupbase.ParserBase):
# Definition of entities -- derived classes may override
entity_or_charref = re.compile('&(?:'
'([a-zA-Z][-.a-zA-Z0-9]*)|#([0-9]+)'
self.lasttag = '???'
self.nomoretags = 0
self.literal = 0
- markupbase.ParserBase.reset(self)
+ _markupbase.ParserBase.reset(self)
def setnomoretags(self):
"""Enter literal mode (CDATA) till EOF.