Public Member Functions | Public Attributes
wikidot.myparser.MyParser Class Reference
Inheritance diagram for wikidot.myparser.MyParser:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

Initialize the parser

Definition at line 28 of file myparser.py.


Member Function Documentation

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.

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.

Reset the parser's state

Reimplemented in wikidot.fixurl.FixURL.

Definition at line 34 of file myparser.py.


Member Data Documentation

Definition at line 34 of file myparser.py.


The documentation for this class was generated from the following file:


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:40