File "xmlreader.cpython-36.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python36/lib64/python3.6/xml/sax/__pycache__/xmlreader.cpython-36.pyc
File size: 16.54 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3

 f1@sdZddlmZddlmZmZGdddZGdddeZGdd	d	ZGd
ddZ	Gdd
d
Z
Gddde
ZddZe
dkredS)z]An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. )handler)SAXNotSupportedExceptionSAXNotRecognizedExceptionc@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd S)!	XMLReadera%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)	rZContentHandler
_cont_handlerZ
DTDHandler_dtd_handlerZEntityResolver_ent_handlerZErrorHandler_err_handler)selfr6/opt/alt/python36/lib64/python3.6/xml/sax/xmlreader.py__init__s


zXMLReader.__init__cCstddS)zAParse an XML document from a system identifier or an InputSource.z This method must be implemented!N)NotImplementedError)r
sourcerrrparseszXMLReader.parsecCs|jS)z#Returns the current ContentHandler.)r)r
rrrgetContentHandler"szXMLReader.getContentHandlercCs
||_dS)z:Registers a new object to receive document content events.N)r)r
rrrrsetContentHandler&szXMLReader.setContentHandlercCs|jS)z Returns the current DTD handler.)r)r
rrr
getDTDHandler*szXMLReader.getDTDHandlercCs
||_dS)z7Register an object to receive basic DTD-related events.N)r)r
rrrr
setDTDHandler.szXMLReader.setDTDHandlercCs|jS)z#Returns the current EntityResolver.)r)r
rrrgetEntityResolver2szXMLReader.getEntityResolvercCs
||_dS)z0Register an object to resolve external entities.N)r)r
ZresolverrrrsetEntityResolver6szXMLReader.setEntityResolvercCs|jS)z!Returns the current ErrorHandler.)r	)r
rrrgetErrorHandler:szXMLReader.getErrorHandlercCs
||_dS)z3Register an object to receive error-message events.N)r	)r
rrrrsetErrorHandler>szXMLReader.setErrorHandlercCstddS)aHAllow 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.zLocale support not implementedN)r)r
Zlocalerrr	setLocaleBszXMLReader.setLocalecCstd|dS)z1Looks up and returns the state of a SAX2 feature.zFeature '%s' not recognizedN)r)r
namerrr
getFeatureKszXMLReader.getFeaturecCstd|dS)z!Sets the state of a SAX2 feature.zFeature '%s' not recognizedN)r)r
rstaterrr
setFeatureOszXMLReader.setFeaturecCstd|dS)z2Looks up and returns the value of a SAX2 property.zProperty '%s' not recognizedN)r)r
rrrrgetPropertySszXMLReader.getPropertycCstd|dS)z"Sets the value of a SAX2 property.zProperty '%s' not recognizedN)r)r
rvaluerrrsetPropertyWszXMLReader.setPropertyN)__name__
__module____qualname____doc__r
rrrrrrrrrrrrrr rrrrrs 	rc@sBeZdZdZdddZddZdd	Zd
dZdd
ZddZ	dS)IncrementalParserasThis 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.cCs||_tj|dS)N)_bufsizerr
)r
bufsizerrrr
oszIncrementalParser.__init__cCspddlm}|j|}|j||j}|dkr8|j}|j|j}x|rb|j||j|j}qFW|j	dS)Nr)saxutils)
r*Zprepare_input_source
prepareParsergetCharacterStream
getByteStreamreadr(feedclose)r
rr*filebufferrrrrss


zIncrementalParser.parsecCstddS)aThis 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.z This method must be implemented!N)r)r
datarrrr0szIncrementalParser.feedcCstddS)ztThis method is called by the parse implementation to allow
        the SAX 2.0 driver to prepare itself for parsing.z!prepareParser must be overridden!N)r)r
rrrrr,szIncrementalParser.prepareParsercCstddS)aThis 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.z This method must be implemented!N)r)r
rrrr1szIncrementalParser.closecCstddS)zThis 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.z This method must be implemented!N)r)r
rrrresetszIncrementalParser.resetN)r6)
r!r"r#r$r
rr0r,r1r5rrrrr%[s
	
r%c@s0eZdZdZddZddZddZdd	Zd
S)LocatorzInterface 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)z6Return the column number where the current event ends.rr)r
rrrgetColumnNumberszLocator.getColumnNumbercCsdS)z4Return the line number where the current event ends.rr8r)r
rrr
getLineNumberszLocator.getLineNumbercCsdS)z3Return the public identifier for the current event.Nr)r
rrrgetPublicIdszLocator.getPublicIdcCsdS)z3Return the system identifier for the current event.Nr)r
rrrgetSystemIdszLocator.getSystemIdN)r!r"r#r$r9r:r;r<rrrrr7s
r7c@sjeZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZdS)InputSourceanEncapsulation 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.NcCs"||_d|_d|_d|_d|_dS)N)_InputSource__system_id_InputSource__public_id_InputSource__encoding_InputSource__bytefile_InputSource__charfile)r
	system_idrrrr
s
zInputSource.__init__cCs
||_dS)z/Sets the public identifier of this InputSource.N)r?)r
Z	public_idrrrsetPublicIdszInputSource.setPublicIdcCs|jS)z2Returns the public identifier of this InputSource.)r?)r
rrrr;szInputSource.getPublicIdcCs
||_dS)z/Sets the system identifier of this InputSource.N)r>)r
rCrrrsetSystemIdszInputSource.setSystemIdcCs|jS)z2Returns the system identifier of this InputSource.)r>)r
rrrr<szInputSource.getSystemIdcCs
||_dS)a4Sets 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)r@)r
encodingrrrsetEncodingszInputSource.setEncodingcCs|jS)z/Get the character encoding of this InputSource.)r@)r
rrrgetEncodingszInputSource.getEncodingcCs
||_dS)aSet 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)rA)r
Zbytefilerrr
setByteStreamszInputSource.setByteStreamcCs|jS)zGet the byte stream for this input source.

        The getEncoding method will return the character encoding for
        this byte stream, or None if unknown.)rA)r
rrrr.szInputSource.getByteStreamcCs
||_dS)a^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)rB)r
ZcharfilerrrsetCharacterStreamszInputSource.setCharacterStreamcCs|jS)z/Get the character stream for this input source.)rB)r
rrrr-szInputSource.getCharacterStream)N)r!r"r#r$r
rDr;rEr<rGrHrIr.rJr-rrrrr=s



r=c@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZd$ddZddZd d!Zd"d#ZdS)%AttributesImplcCs
||_dS)zQNon-NS-aware implementation.

        attrs should be of the form {name : value}.N)_attrs)r
attrsrrrr
szAttributesImpl.__init__cCs
t|jS)N)lenrL)r
rrr	getLengthszAttributesImpl.getLengthcCsdS)NZCDATAr)r
rrrrgetType!szAttributesImpl.getTypecCs
|j|S)N)rL)r
rrrrgetValue$szAttributesImpl.getValuecCs
|j|S)N)rL)r
rrrrgetValueByQName'szAttributesImpl.getValueByQNamecCs||jkrt||S)N)rLKeyError)r
rrrrgetNameByQName*s
zAttributesImpl.getNameByQNamecCs||jkrt||S)N)rLrS)r
rrrrgetQNameByName/s
zAttributesImpl.getQNameByNamecCst|jjS)N)listrLkeys)r
rrrgetNames4szAttributesImpl.getNamescCst|jjS)N)rVrLrW)r
rrr	getQNames7szAttributesImpl.getQNamescCs
t|jS)N)rNrL)r
rrr__len__:szAttributesImpl.__len__cCs
|j|S)N)rL)r
rrrr__getitem__=szAttributesImpl.__getitem__cCst|jjS)N)rVrLrW)r
rrrrW@szAttributesImpl.keyscCs
||jkS)N)rL)r
rrrr__contains__CszAttributesImpl.__contains__NcCs|jj||S)N)rLget)r
rZalternativerrrr]FszAttributesImpl.getcCs|j|jS)N)	__class__rL)r
rrrcopyIszAttributesImpl.copycCst|jjS)N)rVrLitems)r
rrrr`LszAttributesImpl.itemscCst|jjS)N)rVrLvalues)r
rrrraOszAttributesImpl.values)N)r!r"r#r
rOrPrQrRrTrUrXrYrZr[rWr\r]r_r`rarrrrrKs"
rKc@s<eZdZddZddZddZddZd	d
ZddZd
S)AttributesNSImplcCs||_||_dS)zNS-aware implementation.

        attrs should be of the form {(ns_uri, lname): value, ...}.
        qnames of the form {(ns_uri, lname): qname, ...}.N)rL_qnames)r
rMZqnamesrrrr
VszAttributesNSImpl.__init__cCs6x(|jjD]\}}||kr|j|SqWt|dS)N)rcr`rLrS)r
rnsnameqnamerrrrR^sz AttributesNSImpl.getValueByQNamecCs0x"|jjD]\}}||kr|SqWt|dS)N)rcr`rS)r
rrdrerrrrTeszAttributesNSImpl.getNameByQNamecCs
|j|S)N)rc)r
rrrrrUlszAttributesNSImpl.getQNameByNamecCst|jjS)N)rVrcra)r
rrrrYoszAttributesNSImpl.getQNamescCs|j|j|jS)N)r^rLrc)r
rrrr_rszAttributesNSImpl.copyN)	r!r"r#r
rRrTrUrYr_rrrrrbTsrbcCstttdS)N)rr%r7rrrr_testvsrf__main__N)r$r+r_exceptionsrrrr%r7r=rKrbrfr!rrrr<module>sPJY>"