AlkantarClanX12

Your IP : 18.189.186.247


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

U

e5d�/�@s�ddlZddlZddlZddlZddlZddlmZddlmZdd�Z	ifdd�Z
ifd	d
�Zifdd�Zd
d�Z
Gdd�dej�ZGdd�dej�Zddd�ZdS)�N�)�handler)�	xmlreadercCs"|��D]\}}|�||�}q|S�N)�items�replace)�s�d�key�value�r�(/usr/lib64/python3.8/xml/sax/saxutils.py�__dict_replacesrcCs6|�dd�}|�dd�}|�dd�}|r2t||�}|S)N�&�&amp;�>�&gt;�<�&lt;�rr��dataZentitiesrrr
�escapes	
rcCs2|�dd�}|�dd�}|r&t||�}|�dd�S)Nrrrrrrrrrrr
�unescape"s

rcCsR|dddd��}t||�}d|krFd|kr<d|�dd�}qNd	|}nd|}|S)
Nz&#10;z&#13;z&#9;)�
�
�	�"�'z"%s"z&quot;z'%s')rrrrrr
�	quoteattr0s

rcs��dkrddl}|jSt�tj�r&�St�tjtjf�r<�St�tj�rlG�fdd�d�}|�}dd�|_	nDt�
�}dd�|_�j|_z�j
|_
�j|_Wntk
r�YnXtj||ddd	d
�S)NrcseZdZ�jZ�fdd�ZdS)z _gettextwriter.<locals>._wrappercs
t�|�Sr)�getattr��self�name��outrr
�__getattr__Zsz,_gettextwriter.<locals>._wrapper.__getattr__N)�__name__�
__module__�__qualname__�	__class__r&rr$rr
�_wrapperXsr+cSsdSrrrrrr
�<lambda>]�z _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrr
r,br-�xmlcharrefreplacerT)�encoding�errors�newline�
write_through)�sys�stdout�
isinstance�io�
TextIOBase�codecs�StreamWriter�StreamReaderWriter�	RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError�
TextIOWrapper)r%r/r3r+�bufferrr$r
�_gettextwriterGs0
�rEc@s�eZdZd dd�Zdd�Zd!dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)"�XMLGeneratorN�
iso-8859-1FcCsVtj�|�t||�}|j|_|j|_ig|_|jd|_	g|_
||_||_d|_
dS)N���F)r�ContentHandler�__init__rEr?�_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps�	_encoding�_short_empty_elements�_pending_start_element)r"r%r/Zshort_empty_elementsrrr
rJrs
zXMLGenerator.__init__cCsJ|drBd|dkr d|dS|j|d}|rB|d|dS|dS)Nrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rO)r"r#�prefixrrr
�_qname~szXMLGenerator._qnamecCs|jr|�d�d|_dS)NrF�rSrK)r"�
endElementrrr
�_finish_pending_start_element�s
z*XMLGenerator._finish_pending_start_elementcCs|�d|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rKrQ�r"rrr
�
startDocument�s�zXMLGenerator.startDocumentcCs|��dSr)rMrZrrr
�endDocument�szXMLGenerator.endDocumentcCs0|j�|j���||j|<|j�||f�dSr)rN�appendrO�copyrP�r"rU�urirrr
�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrH)rNrO�r"rUrrr
�endPrefixMapping�szXMLGenerator.endPrefixMappingcCsZ|��|�d|�|��D]\}}|�d|t|�f�q|jrLd|_n
|�d�dS)Nr� %s=%sTr)rYrKrrrRrS)r"r#�attrsrrrr
�startElement�szXMLGenerator.startElementcCs*|jr|�d�d|_n|�d|�dS�Nz/>Fz</%s>rWr!rrr
rX�s
zXMLGenerator.endElementcCs�|��|�d|�|��|jD].\}}|rB|�d||f�q"|�d|�q"g|_|��D]$\}}|�d|�|�t|�f�q`|jr�d|_n
|�d�dS)Nrz xmlns:%s="%s"z xmlns="%s"rdTr)rYrKrVrPrrrRrS)r"r#�qnamererUr`rrrr
�startElementNS�szXMLGenerator.startElementNScCs0|jr|�d�d|_n|�d|�|��dSrg)rSrKrV�r"r#rhrrr
�endElementNS�s
zXMLGenerator.endElementNScCs4|r0|��t|t�s"t||j�}|�t|��dSr)rYr5�strrQrKr�r"Zcontentrrr
�
characters�s

zXMLGenerator.characterscCs0|r,|��t|t�s"t||j�}|�|�dSr)rYr5rlrQrKrmrrr
�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs|��|�d||f�dS)Nz	<?%s %s?>)rYrK�r"�targetrrrr
�processingInstruction�sz"XMLGenerator.processingInstruction)NrGF)F)r'r(r)rJrVrYr[r\rarcrfrXrirkrnrorrrrrr
rFps


rFc@s�eZdZd:dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS);�
XMLFilterBaseNcCstj�|�||_dSr)r�	XMLReaderrJ�_parent�r"�parentrrr
rJ�szXMLFilterBase.__init__cCs|j�|�dSr)�_err_handler�error�r"Z	exceptionrrr
ry�szXMLFilterBase.errorcCs|j�|�dSr)rx�
fatalErrorrzrrr
r{�szXMLFilterBase.fatalErrorcCs|j�|�dSr)rx�warningrzrrr
r|�szXMLFilterBase.warningcCs|j�|�dSr)�
_cont_handler�setDocumentLocator)r"Zlocatorrrr
r~�sz XMLFilterBase.setDocumentLocatorcCs|j��dSr)r}r[rZrrr
r[�szXMLFilterBase.startDocumentcCs|j��dSr)r}r\rZrrr
r\szXMLFilterBase.endDocumentcCs|j�||�dSr)r}rar_rrr
rasz XMLFilterBase.startPrefixMappingcCs|j�|�dSr)r}rcrbrrr
rcszXMLFilterBase.endPrefixMappingcCs|j�||�dSr)r}rf)r"r#rerrr
rfszXMLFilterBase.startElementcCs|j�|�dSr)r}rXr!rrr
rXszXMLFilterBase.endElementcCs|j�|||�dSr)r}ri)r"r#rhrerrr
riszXMLFilterBase.startElementNScCs|j�||�dSr)r}rkrjrrr
rkszXMLFilterBase.endElementNScCs|j�|�dSr)r}rnrmrrr
rnszXMLFilterBase.characterscCs|j�|�dSr)r}ro)r"�charsrrr
rosz!XMLFilterBase.ignorableWhitespacecCs|j�||�dSr)r}rrrprrr
rrsz#XMLFilterBase.processingInstructioncCs|j�|�dSr)r}�
skippedEntityr!rrr
r� szXMLFilterBase.skippedEntitycCs|j�|||�dSr)�_dtd_handler�notationDecl)r"r#�publicId�systemIdrrr
r�%szXMLFilterBase.notationDeclcCs|j�||||�dSr)r��unparsedEntityDecl)r"r#r�r�Zndatarrr
r�(sz XMLFilterBase.unparsedEntityDeclcCs|j�||�Sr)Z_ent_handler�
resolveEntity)r"r�r�rrr
r�-szXMLFilterBase.resolveEntitycCs@|j�|�|j�|�|j�|�|j�|�|j�|�dSr)ruZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r"�sourcerrr
r�2s
zXMLFilterBase.parsecCs|j�|�dSr)ru�	setLocale)r"Zlocalerrr
r�9szXMLFilterBase.setLocalecCs|j�|�Sr)ru�
getFeaturer!rrr
r�<szXMLFilterBase.getFeaturecCs|j�||�dSr)ru�
setFeature)r"r#�staterrr
r�?szXMLFilterBase.setFeaturecCs|j�|�Sr)ru�getPropertyr!rrr
r�BszXMLFilterBase.getPropertycCs|j�||�dSr)ru�setProperty)r"r#rrrr
r�EszXMLFilterBase.setPropertycCs|jSr�rurZrrr
�	getParentJszXMLFilterBase.getParentcCs
||_dSrr�rvrrr
�	setParentMszXMLFilterBase.setParent)N)r'r(r)rJryr{r|r~r[r\rarcrfrXrirkrnrorrr�r�r�r�r�r�r�r�r�r�r�r�rrrr
rs�s8
rs�cCs$t|tj�rt�|�}t|t�r,t�|�}n^t|d�r�|}t��}t|�d�t�r^|�	|�n
|�
|�t|d�r�t|jt�r�|�|j�|�
�dk�r |��dk�r |��}tj�tj�|��}tj�||�}tj�|�r�|�|�t|d�}n$|�tj�||��tj�|���}|�
|�|S)N�readrr#�rb)r5�os�PathLike�fspathrlrZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamr#ZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�path�dirname�normpath�join�isfile�open�urllibr�ZurljoinZrequestZurlopen)r��base�fZsysidZbaseheadZ
sysidfilenamerrr
�prepare_input_sourceRs.





r�)r�)r�Zurllib.parser�Zurllib.requestr6r8r�rrrrrrrErIrFrtrsr�rrrr
�<module>s)so