Your IP : 3.145.84.128


Current Path : /opt/alt/python38/lib64/python3.8/xml/sax/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/xml/sax/__pycache__/xmlreader.cpython-38.opt-2.pyc

U

i�f�1�@s�ddlmZddlmZmZGdd�d�ZGdd�de�ZGdd�d�ZGd	d
�d
�ZGdd�d�Z	Gd
d�de	�Z
dd�Zedkr�e�dS)�)�handler)�SAXNotSupportedException�SAXNotRecognizedExceptionc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �	XMLReadercCs,t��|_t��|_t��|_t��|_dS�N)	rZContentHandler�
_cont_handlerZ
DTDHandler�_dtd_handlerZEntityResolver�_ent_handlerZErrorHandler�_err_handler��self�r
�6/opt/alt/python38/lib64/python3.8/xml/sax/xmlreader.py�__init__s


zXMLReader.__init__cCstd��dS�Nz This method must be implemented!��NotImplementedError�r�sourcer
r
r�parseszXMLReader.parsecCs|jSr�rrr
r
r�getContentHandler"szXMLReader.getContentHandlercCs
||_dSrr�rrr
r
r�setContentHandler&szXMLReader.setContentHandlercCs|jSr�rrr
r
r�
getDTDHandler*szXMLReader.getDTDHandlercCs
||_dSrrrr
r
r�
setDTDHandler.szXMLReader.setDTDHandlercCs|jSr�r	rr
r
r�getEntityResolver2szXMLReader.getEntityResolvercCs
||_dSrr)rZresolverr
r
r�setEntityResolver6szXMLReader.setEntityResolvercCs|jSr�r
rr
r
r�getErrorHandler:szXMLReader.getErrorHandlercCs
||_dSrr rr
r
r�setErrorHandler>szXMLReader.setErrorHandlercCstd��dS)NzLocale support not implemented)r)rZlocaler
r
r�	setLocaleBszXMLReader.setLocalecCstd|��dS�NzFeature '%s' not recognized�r�r�namer
r
r�
getFeatureKszXMLReader.getFeaturecCstd|��dSr$r%)rr'�stater
r
r�
setFeatureOszXMLReader.setFeaturecCstd|��dS�NzProperty '%s' not recognizedr%r&r
r
r�getPropertySszXMLReader.getPropertycCstd|��dSr+r%)rr'�valuer
r
r�setPropertyWszXMLReader.setPropertyN)�__name__�
__module__�__qualname__rrrrrrrrr!r"r#r(r*r,r.r
r
r
rrs
	rc@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�IncrementalParser�cCs||_t�|�dSr)�_bufsizerr)r�bufsizer
r
rroszIncrementalParser.__init__cCslddlm}|�|�}|�|�|��}|dkr8|��}|�|j�}|r`|�|�|�|j�}qD|�	�dS)Nr)�saxutils)
�r6Zprepare_input_source�
prepareParser�getCharacterStream�
getByteStream�readr4�feed�close)rrr6�file�bufferr
r
rrss


zIncrementalParser.parsecCstd��dSrr)r�datar
r
rr<�szIncrementalParser.feedcCstd��dS)Nz!prepareParser must be overridden!rrr
r
rr8�szIncrementalParser.prepareParsercCstd��dSrrrr
r
rr=�szIncrementalParser.closecCstd��dSrrrr
r
r�reset�szIncrementalParser.resetN)r3)	r/r0r1rrr<r8r=rAr
r
r
rr2[s
	
r2c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LocatorcCsdS�N���r
rr
r
r�getColumnNumber�szLocator.getColumnNumbercCsdSrCr
rr
r
r�
getLineNumber�szLocator.getLineNumbercCsdSrr
rr
r
r�getPublicId�szLocator.getPublicIdcCsdSrr
rr
r
r�getSystemId�szLocator.getSystemIdN)r/r0r1rErFrGrHr
r
r
rrB�srBc@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�InputSourceNcCs"||_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
||_dSr�rK)rZ	public_idr
r
r�setPublicId�szInputSource.setPublicIdcCs|jSrrPrr
r
rrG�szInputSource.getPublicIdcCs
||_dSr�rJrOr
r
r�setSystemId�szInputSource.setSystemIdcCs|jSrrRrr
r
rrH�szInputSource.getSystemIdcCs
||_dSr�rL)r�encodingr
r
r�setEncoding�szInputSource.setEncodingcCs|jSrrTrr
r
r�getEncoding�szInputSource.getEncodingcCs
||_dSr�rM)rZbytefiler
r
r�
setByteStream�szInputSource.setByteStreamcCs|jSrrXrr
r
rr:�szInputSource.getByteStreamcCs
||_dSr�rN)rZcharfiler
r
r�setCharacterStreamszInputSource.setCharacterStreamcCs|jSrrZrr
r
rr9szInputSource.getCharacterStream)N)r/r0r1rrQrGrSrHrVrWrYr:r[r9r
r
r
rrI�s



rIc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd$dd�Zdd�Zd d!�Zd"d#�ZdS)%�AttributesImplcCs
||_dSr��_attrs)r�attrsr
r
rrszAttributesImpl.__init__cCs
t|j�Sr��lenr^rr
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||jkrt|��|Sr�r^�KeyErrorr&r
r
r�getNameByQName*s
zAttributesImpl.getNameByQNamecCs||jkrt|��|Srrfr&r
r
r�getQNameByName/s
zAttributesImpl.getQNameByNamecCst|j���Sr��listr^�keysrr
r
r�getNames4szAttributesImpl.getNamescCst|j���Srrjrr
r
r�	getQNames7szAttributesImpl.getQNamescCs
t|j�Srr`rr
r
r�__len__:szAttributesImpl.__len__cCs
|j|Srr]r&r
r
r�__getitem__=szAttributesImpl.__getitem__cCst|j���Srrjrr
r
rrl@szAttributesImpl.keyscCs
||jkSrr]r&r
r
r�__contains__CszAttributesImpl.__contains__NcCs|j�||�Sr)r^�get)rr'Zalternativer
r
rrrFszAttributesImpl.getcCs|�|j�Sr)�	__class__r^rr
r
r�copyIszAttributesImpl.copycCst|j���Sr)rkr^�itemsrr
r
rruLszAttributesImpl.itemscCst|j���Sr)rkr^�valuesrr
r
rrvOszAttributesImpl.values)N)r/r0r1rrbrcrdrerhrirmrnrorprlrqrrrtrurvr
r
r
rr\s"
r\c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�AttributesNSImplcCs||_||_dSr)r^�_qnames)rr_Zqnamesr
r
rrVszAttributesNSImpl.__init__cCs6|j��D]\}}||kr
|j|Sq
t|��dSr)rxrur^rg�rr'ZnsnameZqnamer
r
rre^sz AttributesNSImpl.getValueByQNamecCs0|j��D]\}}||kr
|Sq
t|��dSr)rxrurgryr
r
rrhes
zAttributesNSImpl.getNameByQNamecCs
|j|Sr)rxr&r
r
rrilszAttributesNSImpl.getQNameByNamecCst|j���Sr)rkrxrvrr
r
rrnoszAttributesNSImpl.getQNamescCs|�|j|j�Sr)rsr^rxrr
r
rrtrszAttributesNSImpl.copyN)	r/r0r1rrerhrirnrtr
r
r
rrwTsrwcCst�t�t�dSr)rr2rBr
r
r
r�_testvsrz�__main__N)
r7r�_exceptionsrrrr2rBrIr\rwrzr/r
r
r
r�<module>sPJY>"

?>