#NEWLINE# def __init__( self , html = 0 , target = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# from xml.parsers import expat #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise ImportError ( 'No module named expat; use SimpleXMLTreeBuilder instead' ) #NEWLINE# #UNINDENT# self . _parser = parser = expat . ParserCreate ( None , '}' ) #NEWLINE# if ( target is None ) : #NEWLINE# #INDENT# target = TreeBuilder ( ) #NEWLINE# #UNINDENT# self . _target = target #NEWLINE# self . _names = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# parser . DefaultHandlerExpand = self . _default #NEWLINE# parser . StartElementHandler = self . _start #NEWLINE# parser . EndElementHandler = self . _end #NEWLINE# parser . CharacterDataHandler = self . _data #NEWLINE# try : #NEWLINE# #INDENT# self . _parser . buffer_text = 1 #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . _parser . ordered_attributes = 1 #NEWLINE# self . _parser . specified_attributes = 1 #NEWLINE# parser . StartElementHandler = parser . _start_list #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# encoding = None #NEWLINE# if ( not parser . returns_unicode ) : #NEWLINE# #INDENT# encoding = 'utf-8' #NEWLINE# #UNINDENT# self . _doctype = None #NEWLINE# self . entity = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }