AlkantarClanX12

Your IP : 18.116.52.43


Current Path : /opt/alt/python33/lib64/python3.3/xml/sax/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/xml/sax/__pycache__/xmlreader.cpython-33.pyc

�
��fD1c@s�dZddlmZddlmZmZGdd�d�ZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
Gdd�de
�Zdd�Ze
dkr�e�ndS(u]An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. i(uhandler(uSAXNotSupportedExceptionuSAXNotRecognizedExceptioncBs�|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S(!u	XMLReaderu%Interface for reading an XML document using callbacks.

    XMLReader is the interface that an XML parser's SAX2 driver must
    implement. This interface allows an application to set and query
    features and properties in the parser, to register event handlers
    for document processing, and to initiate a document parse.

    All SAX interfaces are assumed to be synchronous: the parse
    methods must not return until parsing is complete, and readers
    must wait for an event-handler callback to return before reporting
    the next event.cCs@tj�|_tj�|_tj�|_tj�|_dS(N(	uhandleruContentHandleru
_cont_handleru
DTDHandleru_dtd_handleruEntityResolveru_ent_handleruErrorHandleru_err_handler(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__init__suXMLReader.__init__cCstd��dS(uAParse an XML document from a system identifier or an InputSource.u This method must be implemented!N(uNotImplementedError(uselfusource((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuparsesuXMLReader.parsecCs|jS(u#Returns the current ContentHandler.(u
_cont_handler(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetContentHandler"suXMLReader.getContentHandlercCs
||_dS(u:Registers a new object to receive document content events.N(u
_cont_handler(uselfuhandler((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetContentHandler&suXMLReader.setContentHandlercCs|jS(u Returns the current DTD handler.(u_dtd_handler(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
getDTDHandler*suXMLReader.getDTDHandlercCs
||_dS(u7Register an object to receive basic DTD-related events.N(u_dtd_handler(uselfuhandler((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
setDTDHandler.suXMLReader.setDTDHandlercCs|jS(u#Returns the current EntityResolver.(u_ent_handler(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetEntityResolver2suXMLReader.getEntityResolvercCs
||_dS(u0Register an object to resolve external entities.N(u_ent_handler(uselfuresolver((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetEntityResolver6suXMLReader.setEntityResolvercCs|jS(u!Returns the current ErrorHandler.(u_err_handler(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetErrorHandler:suXMLReader.getErrorHandlercCs
||_dS(u3Register an object to receive error-message events.N(u_err_handler(uselfuhandler((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetErrorHandler>suXMLReader.setErrorHandlercCstd��dS(uHAllow an application to set the locale for errors and warnings.

        SAX parsers are not required to provide localization for errors
        and warnings; if they cannot support the requested locale,
        however, they must raise a SAX exception. Applications may
        request a locale change in the middle of a parse.uLocale support not implementedN(uSAXNotSupportedException(uselfulocale((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu	setLocaleBsuXMLReader.setLocalecCstd|��dS(u1Looks up and returns the state of a SAX2 feature.uFeature '%s' not recognizedN(uSAXNotRecognizedException(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
getFeatureKsuXMLReader.getFeaturecCstd|��dS(u!Sets the state of a SAX2 feature.uFeature '%s' not recognizedN(uSAXNotRecognizedException(uselfunameustate((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
setFeatureOsuXMLReader.setFeaturecCstd|��dS(u2Looks up and returns the value of a SAX2 property.uProperty '%s' not recognizedN(uSAXNotRecognizedException(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetPropertySsuXMLReader.getPropertycCstd|��dS(u"Sets the value of a SAX2 property.uProperty '%s' not recognizedN(uSAXNotRecognizedException(uselfunameuvalue((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetPropertyWsuXMLReader.setPropertyN(u__name__u
__module__u__qualname__u__doc__u__init__uparseugetContentHandlerusetContentHandleru
getDTDHandleru
setDTDHandlerugetEntityResolverusetEntityResolverugetErrorHandlerusetErrorHandleru	setLocaleu
getFeatureu
setFeatureugetPropertyusetProperty(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu	XMLReaders 	u	XMLReadercBse|EeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS(uIncrementalParserusThis interface adds three extra methods to the XMLReader
    interface that allow XML parsers to support incremental
    parsing. Support for this interface is optional, since not all
    underlying XML parsers support this functionality.

    When the parser is instantiated it is ready to begin accepting
    data from the feed method immediately. After parsing has been
    finished with a call to close the reset method must be called to
    make the parser ready to accept new data, either from feed or
    using the parse method.

    Note that these methods must _not_ be called during parsing, that
    is, after parse has been called and before it returns.

    By default, the class also implements the parse method of the XMLReader
    interface using the feed, close and reset methods of the
    IncrementalParser interface as a convenience to SAX 2.0 driver
    writers.iicCs||_tj|�dS(N(u_bufsizeu	XMLReaderu__init__(uselfubufsize((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__init__os	uIncrementalParser.__init__cCs�ddlm}|j|�}|j|�|j�}|j|j�}x)|ru|j|�|j|j�}qMW|j�dS(Ni(usaxutils(	uusaxutilsuprepare_input_sourceu
prepareParseru
getByteStreamureadu_bufsizeufeeduclose(uselfusourceusaxutilsufileubuffer((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuparsess
	
uIncrementalParser.parsecCstd��dS(uThis method gives the raw XML data in the data parameter to
        the parser and makes it parse the data, emitting the
        corresponding events. It is allowed for XML constructs to be
        split across several calls to feed.

        feed may raise SAXException.u This method must be implemented!N(uNotImplementedError(uselfudata((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyufeedsuIncrementalParser.feedcCstd��dS(utThis method is called by the parse implementation to allow
        the SAX 2.0 driver to prepare itself for parsing.u!prepareParser must be overridden!N(uNotImplementedError(uselfusource((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
prepareParser�suIncrementalParser.prepareParsercCstd��dS(u�This method is called when the entire XML document has been
        passed to the parser through the feed method, to notify the
        parser that there are no more data. This allows the parser to
        do the final checks on the document and empty the internal
        data buffer.

        The parser will not be ready to parse another document until
        the reset method has been called.

        close may raise SAXException.u This method must be implemented!N(uNotImplementedError(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuclose�suIncrementalParser.closecCstd��dS(u�This method is called after close has been called to reset
        the parser so that it is ready to parse new documents. The
        results of calling parse or feed after close without calling
        reset are undefined.u This method must be implemented!N(uNotImplementedError(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyureset�suIncrementalParser.resetNi(
u__name__u
__module__u__qualname__u__doc__u__init__uparseufeedu
prepareParserucloseureset(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuIncrementalParser[s	
uIncrementalParsercBsJ|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S(uLocatoru�Interface for associating a SAX event with a document
    location. A locator object will return valid results only during
    calls to DocumentHandler methods; at any other time, the
    results are unpredictable.cCsdS(u6Return the column number where the current event ends.ii����((uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetColumnNumber�suLocator.getColumnNumbercCsdS(u4Return the line number where the current event ends.ii����((uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
getLineNumber�suLocator.getLineNumbercCsdS(u3Return the public identifier for the current event.N(uNone(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetPublicId�suLocator.getPublicIdcCsdS(u3Return the system identifier for the current event.N(uNone(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetSystemId�suLocator.getSystemIdN(u__name__u
__module__u__qualname__u__doc__ugetColumnNumberu
getLineNumberugetPublicIdugetSystemId(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuLocator�s
uLocatorcBs�|EeZdZdZddd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS(uInputSourceunEncapsulation of the information needed by the XMLReader to
    read entities.

    This class may include information about the public identifier,
    system identifier, byte stream (possibly with character encoding
    information) and/or the character stream of an entity.

    Applications will create objects of this class for use in the
    XMLReader.parse method and for returning from
    EntityResolver.resolveEntity.

    An InputSource belongs to the application, the XMLReader is not
    allowed to modify InputSource objects passed to it from the
    application, although it may make copies and modify those.cCs1||_d|_d|_d|_d|_dS(N(u_InputSource__system_iduNoneu_InputSource__public_idu_InputSource__encodingu_InputSource__bytefileu_InputSource__charfile(uselfu	system_id((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__init__�s
				uInputSource.__init__cCs
||_dS(u/Sets the public identifier of this InputSource.N(u_InputSource__public_id(uselfu	public_id((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetPublicId�suInputSource.setPublicIdcCs|jS(u2Returns the public identifier of this InputSource.(u_InputSource__public_id(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetPublicId�suInputSource.getPublicIdcCs
||_dS(u/Sets the system identifier of this InputSource.N(u_InputSource__system_id(uselfu	system_id((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetSystemId�suInputSource.setSystemIdcCs|jS(u2Returns the system identifier of this InputSource.(u_InputSource__system_id(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetSystemId�suInputSource.getSystemIdcCs
||_dS(u4Sets the character encoding of this InputSource.

        The encoding must be a string acceptable for an XML encoding
        declaration (see section 4.3.3 of the XML recommendation).

        The encoding attribute of the InputSource is ignored if the
        InputSource also contains a character stream.N(u_InputSource__encoding(uselfuencoding((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetEncoding�suInputSource.setEncodingcCs|jS(u/Get the character encoding of this InputSource.(u_InputSource__encoding(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetEncoding�suInputSource.getEncodingcCs
||_dS(u�Set the byte stream (a Python file-like object which does
        not perform byte-to-character conversion) for this input
        source.

        The SAX parser will ignore this if there is also a character
        stream specified, but it will use a byte stream in preference
        to opening a URI connection itself.

        If the application knows the character encoding of the byte
        stream, it should set it with the setEncoding method.N(u_InputSource__bytefile(uselfubytefile((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
setByteStream�suInputSource.setByteStreamcCs|jS(u�Get the byte stream for this input source.

        The getEncoding method will return the character encoding for
        this byte stream, or None if unknown.(u_InputSource__bytefile(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu
getByteStream�suInputSource.getByteStreamcCs
||_dS(u^Set the character stream for this input source. (The stream
        must be a Python 2.0 Unicode-wrapped file-like that performs
        conversion to Unicode strings.)

        If there is a character stream specified, the SAX parser will
        ignore any byte stream and will not attempt to open a URI
        connection to the system identifier.N(u_InputSource__charfile(uselfucharfile((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyusetCharacterStreamsuInputSource.setCharacterStreamcCs|jS(u/Get the character stream for this input source.(u_InputSource__charfile(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetCharacterStreamsuInputSource.getCharacterStreamN(u__name__u
__module__u__qualname__u__doc__uNoneu__init__usetPublicIdugetPublicIdusetSystemIdugetSystemIdusetEncodingugetEncodingu
setByteStreamu
getByteStreamusetCharacterStreamugetCharacterStream(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuInputSource�s


uInputSourcecBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd#dd�Zdd�Zdd �Zd!d"�Zd#S($uAttributesImplcCs
||_dS(uQNon-NS-aware implementation.

        attrs should be of the form {name : value}.N(u_attrs(uselfuattrs((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__init__suAttributesImpl.__init__cCs
t|j�S(N(ulenu_attrs(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu	getLengthsuAttributesImpl.getLengthcCsdS(NuCDATA((uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetTypesuAttributesImpl.getTypecCs|j|S(N(u_attrs(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetValue"suAttributesImpl.getValuecCs|j|S(N(u_attrs(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetValueByQName%suAttributesImpl.getValueByQNamecCs"||jkrt|��n|S(N(u_attrsuKeyError(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetNameByQName(suAttributesImpl.getNameByQNamecCs"||jkrt|��n|S(N(u_attrsuKeyError(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetQNameByName-suAttributesImpl.getQNameByNamecCst|jj��S(N(ulistu_attrsukeys(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetNames2suAttributesImpl.getNamescCst|jj��S(N(ulistu_attrsukeys(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu	getQNames5suAttributesImpl.getQNamescCs
t|j�S(N(ulenu_attrs(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__len__8suAttributesImpl.__len__cCs|j|S(N(u_attrs(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__getitem__;suAttributesImpl.__getitem__cCst|jj��S(N(ulistu_attrsukeys(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyukeys>suAttributesImpl.keyscCs
||jkS(N(u_attrs(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__contains__AsuAttributesImpl.__contains__cCs|jj||�S(N(u_attrsuget(uselfunameualternative((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetDsuAttributesImpl.getcCs|j|j�S(N(u	__class__u_attrs(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyucopyGsuAttributesImpl.copycCst|jj��S(N(ulistu_attrsuitems(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuitemsJsuAttributesImpl.itemscCst|jj��S(N(ulistu_attrsuvalues(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuvaluesMsuAttributesImpl.valuesN(u__name__u
__module__u__qualname__u__init__u	getLengthugetTypeugetValueugetValueByQNameugetNameByQNameugetQNameByNameugetNamesu	getQNamesu__len__u__getitem__ukeysu__contains__uNoneugetucopyuitemsuvalues(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuAttributesImpls"uAttributesImplcBs\|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S(uAttributesNSImplcCs||_||_dS(u�NS-aware implementation.

        attrs should be of the form {(ns_uri, lname): value, ...}.
        qnames of the form {(ns_uri, lname): qname, ...}.N(u_attrsu_qnames(uselfuattrsuqnames((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu__init__Ts	uAttributesNSImpl.__init__cCsGx4|jj�D]#\}}||kr|j|SqWt|��dS(N(u_qnamesuitemsu_attrsuKeyError(uselfunameunsnameuqname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetValueByQName\su AttributesNSImpl.getValueByQNamecCs@x-|jj�D]\}}||kr|SqWt|��dS(N(u_qnamesuitemsuKeyError(uselfunameunsnameuqname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetNameByQNamecsuAttributesNSImpl.getNameByQNamecCs|j|S(N(u_qnames(uselfuname((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyugetQNameByNamejsuAttributesNSImpl.getQNameByNamecCst|jj��S(N(ulistu_qnamesuvalues(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu	getQNamesmsuAttributesNSImpl.getQNamescCs|j|j|j�S(N(u	__class__u_attrsu_qnames(uself((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyucopypsuAttributesNSImpl.copyN(	u__name__u
__module__u__qualname__u__init__ugetValueByQNameugetNameByQNameugetQNameByNameu	getQNamesucopy(u
__locals__((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyuAttributesNSImplRsuAttributesNSImplcCst�t�t�dS(N(u	XMLReaderuIncrementalParseruLocator(((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu_testtsu_testu__main__N(u__doc__uuhandleru_exceptionsuSAXNotSupportedExceptionuSAXNotRecognizedExceptionu	XMLReaderuIncrementalParseruLocatoruInputSourceuAttributesImpluAttributesNSImplu_testu__name__(((u6/opt/alt/python33/lib64/python3.3/xml/sax/xmlreader.pyu<module>sPHY>"