/usr/lib64/python3.9/xml/sax/__pycache__
NameSizeModeActions
expatreader.cpython-39.opt-1.pyc129990644editdlrm
expatreader.cpython-39.opt-2.pyc125880644editdlrm
expatreader.cpython-39.pyc129990644editdlrm
handler.cpython-39.opt-1.pyc124240644editdlrm
handler.cpython-39.opt-2.pyc46530644editdlrm
handler.cpython-39.pyc124240644editdlrm
saxutils.cpython-39.opt-1.pyc129230644editdlrm
saxutils.cpython-39.opt-2.pyc112680644editdlrm
saxutils.cpython-39.pyc129230644editdlrm
xmlreader.cpython-39.opt-1.pyc168460644editdlrm
xmlreader.cpython-39.opt-2.pyc104090644editdlrm
xmlreader.cpython-39.pyc168460644editdlrm
_exceptions.cpython-39.opt-1.pyc54460644editdlrm
_exceptions.cpython-39.opt-2.pyc28430644editdlrm
_exceptions.cpython-39.pyc54460644editdlrm
__init__.cpython-39.opt-1.pyc32000644editdlrm
__init__.cpython-39.opt-2.pyc21370644editdlrm
__init__.cpython-39.pyc32000644editdlrm
Edit: /usr/lib64/python3.9/xml/sax/__pycache__/xmlreader.cpython-39.opt-1.pyc (16846B)
a ´iŒ1ã@s’dZddlmZddlmZmZGdd„dƒZGdd„deƒZGdd „d ƒZGd d „d ƒZ Gd d „d ƒZ Gdd„de ƒZ dd„Z e dkrŽe ƒdS)z]An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. é)Úhandler)ÚSAXNotSupportedExceptionÚSAXNotRecognizedExceptionc@sˆeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd 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,t ¡|_t ¡|_t ¡|_t ¡|_dS©N) rZContentHandlerÚ _cont_handlerZ DTDHandlerÚ _dtd_handlerZEntityResolverÚ _ent_handlerZ ErrorHandlerÚ _err_handler©Úself©r ú)/usr/lib64/python3.9/xml/sax/xmlreader.pyÚ__init__s   zXMLReader.__init__cCs tdƒ‚dS)zAParse an XML document from a system identifier or an InputSource.ú This method must be implemented!N©ÚNotImplementedError©r Úsourcer r rÚparseszXMLReader.parsecCs|jS)z#Returns the current ContentHandler.©rr r r rÚgetContentHandler"szXMLReader.getContentHandlercCs ||_dS)z:Registers a new object to receive document content events.Nr©r rr r rÚsetContentHandler&szXMLReader.setContentHandlercCs|jS)z Returns the current DTD handler.©rr r r rÚ getDTDHandler*szXMLReader.getDTDHandlercCs ||_dS)z7Register an object to receive basic DTD-related events.Nrrr r rÚ setDTDHandler.szXMLReader.setDTDHandlercCs|jS)z#Returns the current EntityResolver.©r r r r rÚgetEntityResolver2szXMLReader.getEntityResolvercCs ||_dS)z0Register an object to resolve external entities.Nr)r Zresolverr r rÚsetEntityResolver6szXMLReader.setEntityResolvercCs|jS)z!Returns the current ErrorHandler.©r r r r rÚgetErrorHandler:szXMLReader.getErrorHandlercCs ||_dS)z3Register an object to receive error-message events.Nr rr r rÚsetErrorHandler>szXMLReader.setErrorHandlercCs tdƒ‚dS)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 Úlocaler r rÚ setLocaleBszXMLReader.setLocalecCstd|ƒ‚dS)z1Looks up and returns the state of a SAX2 feature.úFeature '%s' not recognizedN©r©r Únamer r rÚ getFeatureKszXMLReader.getFeaturecCstd|ƒ‚dS)z!Sets the state of a SAX2 feature.r%Nr&)r r(Ústater r rÚ setFeatureOszXMLReader.setFeaturecCstd|ƒ‚dS)z2Looks up and returns the value of a SAX2 property.úProperty '%s' not recognizedNr&r'r r rÚ getPropertySszXMLReader.getPropertycCstd|ƒ‚dS)z"Sets the value of a SAX2 property.r,Nr&)r r(Úvaluer r rÚ setPropertyWszXMLReader.setPropertyN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrrr!r"r$r)r+r-r/r r r rr s   rc@sBeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z 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||_t |¡dSr)Ú_bufsizerr)r Úbufsizer r rroszIncrementalParser.__init__cCslddlm}| |¡}| |¡| ¡}|dur8| ¡}| |j¡}|r`| |¡| |j¡}qD|  ¡dS)Nr)Úsaxutils) Úr8Zprepare_input_sourceÚ prepareParserÚgetCharacterStreamÚ getByteStreamÚreadr6ÚfeedÚclose)r rr8ÚfileÚbufferr r rrss     zIncrementalParser.parsecCs tdƒ‚dS)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.rNr)r Údatar r rr>�szIncrementalParser.feedcCs tdƒ‚dS)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!Nrrr r rr:ŠszIncrementalParser.prepareParsercCs tdƒ‚dS)a´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.rNrr r r rr?�s zIncrementalParser.closecCs tdƒ‚dS)zß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.rNrr r r rÚresetœszIncrementalParser.resetN)r5) r0r1r2r3rrr>r:r?rCr r r rr4[s   r4c@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) ÚLocatorzÖ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)z6Return the column number where the current event ends.éÿÿÿÿr r r r rÚgetColumnNumber«szLocator.getColumnNumbercCsdS)z4Return the line number where the current event ends.rEr r r r rÚ getLineNumber¯szLocator.getLineNumbercCsdS)z3Return the public identifier for the current event.Nr r r r rÚ getPublicId³szLocator.getPublicIdcCsdS)z3Return the system identifier for the current event.Nr r r r rÚ getSystemId·szLocator.getSystemIdN)r0r1r2r3rFrGrHrIr r r rrD¥s rDc@sjeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„ZdS)Ú 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|_dSr)Ú_InputSource__system_idÚ_InputSource__public_idÚ_InputSource__encodingÚ_InputSource__bytefileÚ_InputSource__charfile©r Z system_idr r rrÍs zInputSource.__init__cCs ||_dS)z/Sets the public identifier of this InputSource.N©rL)r Z public_idr r rÚ setPublicIdÔszInputSource.setPublicIdcCs|jS)z2Returns the public identifier of this InputSource.rQr r r rrHØszInputSource.getPublicIdcCs ||_dS)z/Sets the system identifier of this InputSource.N©rKrPr r rÚ setSystemIdÜszInputSource.setSystemIdcCs|jS)z2Returns the system identifier of this InputSource.rSr r r rrIà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©rM)r Úencodingr r rÚ setEncodingäszInputSource.setEncodingcCs|jS)z/Get the character encoding of this InputSource.rUr r r rÚ getEncodingîszInputSource.getEncodingcCs ||_dS)aÅ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©rN)r Zbytefiler r rÚ setByteStreamòs zInputSource.setByteStreamcCs|jS)zŸGet the byte stream for this input source. The getEncoding method will return the character encoding for this byte stream, or None if unknown.rYr r r rr<ÿ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©rO)r Zcharfiler r rÚsetCharacterStreamszInputSource.setCharacterStreamcCs|jS)z/Get the character stream for this input source.r[r r r rr;szInputSource.getCharacterStream)N)r0r1r2r3rrRrHrTrIrWrXrZr<r\r;r r r rrJ½s    rJc@s–eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zd$dd„Zdd„Zd d!„Zd"d#„ZdS)%ÚAttributesImplcCs ||_dS)zQNon-NS-aware implementation. attrs should be of the form {name : value}.N©Ú_attrs)r Úattrsr r rrszAttributesImpl.__init__cCs t|jƒSr©Úlenr_r r r rÚ getLengthszAttributesImpl.getLengthcCsdS)NZCDATAr r'r r rÚgetType!szAttributesImpl.getTypecCs |j|Srr^r'r r rÚgetValue$szAttributesImpl.getValuecCs |j|Srr^r'r r rÚgetValueByQName'szAttributesImpl.getValueByQNamecCs||jvrt|ƒ‚|Sr©r_ÚKeyErrorr'r r rÚgetNameByQName*s zAttributesImpl.getNameByQNamecCs||jvrt|ƒ‚|Srrgr'r r rÚgetQNameByName/s zAttributesImpl.getQNameByNamecCst|j ¡ƒSr©Úlistr_Úkeysr r r rÚgetNames4szAttributesImpl.getNamescCst|j ¡ƒSrrkr r r rÚ getQNames7szAttributesImpl.getQNamescCs t|jƒSrrar r r rÚ__len__:szAttributesImpl.__len__cCs |j|Srr^r'r r rÚ __getitem__=szAttributesImpl.__getitem__cCst|j ¡ƒSrrkr r r rrm@szAttributesImpl.keyscCs ||jvSrr^r'r r rÚ __contains__CszAttributesImpl.__contains__NcCs|j ||¡Sr)r_Úget)r r(Ú alternativer r rrsFszAttributesImpl.getcCs | |j¡Sr)Ú __class__r_r r r rÚcopyIszAttributesImpl.copycCst|j ¡ƒSr)rlr_Úitemsr r r rrwLszAttributesImpl.itemscCst|j ¡ƒSr)rlr_Úvaluesr r r rrxOszAttributesImpl.values)N)r0r1r2rrcrdrerfrirjrnrorprqrmrrrsrvrwrxr r r rr]s" r]c@s<eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd S)ÚAttributesNSImplcCs||_||_dS)z–NS-aware implementation. attrs should be of the form {(ns_uri, lname): value, ...}. qnames of the form {(ns_uri, lname): qname, ...}.N)r_Ú_qnames)r r`Zqnamesr r rrVszAttributesNSImpl.__init__cCs6|j ¡D]\}}||kr |j|Sq t|ƒ‚dSr)rzrwr_rh©r r(ZnsnameZqnamer r rrf^sz AttributesNSImpl.getValueByQNamecCs0|j ¡D]\}}||kr |Sq t|ƒ‚dSr)rzrwrhr{r r rries zAttributesNSImpl.getNameByQNamecCs |j|Sr)rzr'r r rrjlszAttributesNSImpl.getQNameByNamecCst|j ¡ƒSr)rlrzrxr r r rrooszAttributesNSImpl.getQNamescCs| |j|j¡Sr)rur_rzr r r rrvrszAttributesNSImpl.copyN) r0r1r2rrfrirjrorvr r r rryTs rycCstƒtƒtƒdSr)rr4rDr r r rÚ_testvsr|Ú__main__N)r3r9rÚ _exceptionsrrrr4rDrJr]ryr|r0r r r rÚs PJY>"