$search
Public Member Functions | |
def | __init__ |
def | format_end_tag |
def | format_start_tag |
def | get_doc |
def | handle_charref |
def | handle_data |
def | handle_decl |
def | handle_endtag |
def | handle_entityref |
def | handle_starttag |
def | reset |
Public Attributes | |
out_doc |
Custom HTML parser, derived from HTMLParser lib. Member functions are overidden to output the HTML document as it, without any changes. The document is retrieved with the get_doc() function.
Definition at line 21 of file myparser.py.
def wikidot::myparser::MyParser::__init__ | ( | self | ) |
Initialize the parser
Definition at line 28 of file myparser.py.
def wikidot::myparser::MyParser::format_end_tag | ( | self, | ||
tag | ||||
) |
Private - Format an </tag>
Definition at line 54 of file myparser.py.
def wikidot::myparser::MyParser::format_start_tag | ( | self, | ||
tag, | ||||
attrs | ||||
) |
Private - Format a <tag attributes>
Definition at line 44 of file myparser.py.
def wikidot::myparser::MyParser::get_doc | ( | self | ) |
Return the parsed document
Definition at line 39 of file myparser.py.
def wikidot::myparser::MyParser::handle_charref | ( | self, | ||
name | ||||
) |
Overidden - Called when a charref (&#xyz) is parsed
Definition at line 76 of file myparser.py.
def wikidot::myparser::MyParser::handle_data | ( | self, | ||
data | ||||
) |
Overidden - Called when some data is encountered
chars = self.badchars_regex.findall(data) if len(chars) > 0: print >> sys.stderr, "Found bad characters: ", chars
Definition at line 67 of file myparser.py.
def wikidot::myparser::MyParser::handle_decl | ( | self, | ||
decl | ||||
) |
Overidden - Called when a SGML declaration (<!) is parsed
Definition at line 84 of file myparser.py.
def wikidot::myparser::MyParser::handle_endtag | ( | self, | ||
tag | ||||
) |
Overidden - Called when an end tag is parsed
Definition at line 63 of file myparser.py.
def wikidot::myparser::MyParser::handle_entityref | ( | self, | ||
name | ||||
) |
Overidden - Called when an entityref (&xyz) is parsed
Definition at line 80 of file myparser.py.
def wikidot::myparser::MyParser::handle_starttag | ( | self, | ||
tag, | ||||
attrs | ||||
) |
Overidden - Called when a start tag is parsed
Reimplemented in wikidot::fixurl::FixURL.
Definition at line 59 of file myparser.py.
def wikidot::myparser::MyParser::reset | ( | self | ) |
Reset the parser's state
Reimplemented in wikidot::fixurl::FixURL.
Definition at line 34 of file myparser.py.
Definition at line 36 of file myparser.py.