(self, parser, name, attrs=None, parent=None,
                 previous=None)
Basic constructor.
Basic constructor.
Basic constructor .
def __init__(self, parser, name, attrs=None, parent=None,
                 previous=None):
        "Basic constructor."

        # We don't actually store the parser object: that lets extracted
        # chunks be garbage-collected
        self.parserClass = parser.__class__
        self.isSelfClosing = parser.isSelfClosingTag(name)
        self.name = name
        if attrs is None:
            attrs = []
        elif isinstance(attrs, dict):
            attrs = attrs.items()
        self.attrs = attrs
        self.contents = []
        self.setup(parent, previous)
        self.hidden = False
        self.containsSubstitutions = False
        self.convertHTMLEntities = parser.convertHTMLEntities
        self.convertXMLEntities = parser.convertXMLEntities
        self.escapeUnrecognizedEntities = parser.escapeUnrecognizedEntities

        # Convert any HTML, XML, or numeric entities in the attribute values.
        convert = lambda(k, val): (k,
                                   re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);",
                                          self._convertEntities,
                                          val))
        self.attrs = map(convert, self.attrs)
def __init__ ( self , parser , name , attrs = None , parent = None , previous = None ) : # We don't actually store the parser object: that lets extracted # chunks be garbage-collected self . parserClass = parser . __class__ self . isSelfClosing = parser . isSelfClosingTag ( name ) self . name = name if attrs is None : attrs = [ ] elif isinstance ( attrs , dict ) : attrs = attrs . items ( ) self . attrs = attrs self . contents = [ ] self . setup ( parent , previous ) self . hidden = False self . containsSubstitutions = False self . convertHTMLEntities = parser . convertHTMLEntities self . convertXMLEntities = parser . convertXMLEntities self . escapeUnrecognizedEntities = parser . escapeUnrecognizedEntities # Convert any HTML, XML, or numeric entities in the attribute values. convert = lambda ( k , val ) : ( k , re . sub ( "&(#\d+|#x[0-9a-fA-F]+|\w+);" , self . _convertEntities , val ) ) self . attrs = map ( convert , self . attrs )