Hacked By AnonymousFox

Current Path : /opt/alt/python35/lib64/python3.5/xml/sax/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/xml/sax/__pycache__/saxutils.cpython-35.opt-2.pyc



���]�/�@s�ddlZddlZddlZddlZddlZddlmZddlmZdd�Z	idd�Z
id	d
�Zidd�Zd
d�Z
Gdd�dej�ZGdd�dej�Zddd�ZdS)�N�)�handler)�	xmlreadercCs3x,|j�D]\}}|j||�}q
W|S)N)�items�replace)�s�d�key�value�r�-/opt/alt/python35/lib64/python3.5/saxutils.py�__dict_replacesr
cCsO|jdd�}|jdd�}|jdd�}|rKt||�}|S)N�&z&amp;�>z&gt;�<z&lt;)rr
)�data�entitiesrrr�escapes	rcCsI|jdd�}|jdd�}|r9t||�}|jdd�S)Nz&lt;rz&gt;rz&amp;r)rr
)rrrrr�unescape"s
rcCs�|j�}|jddddddi�t||�}d|krxd|krkd	|jdd
�}q�d|}n
d	|}|S)N�
z&#10;�
z&#13;�	z&#9;�"�'z"%s"z&quot;z'%s')�copy�updaterr)rrrrr�	quoteattr0s

rcs�dkrddl}|jSt�tj�r5�St�tjtjf�rT�St�tj�r�G�fdd�d�}|�}dd�|_	nXtj
�}dd�|_�j|_y�j
|_
�j|_Wntk
r�YnXtj|d|dd	d
ddd
�S)Nrcs+eZdZ�jZ�fdd�ZdS)z _gettextwriter.<locals>._wrappercs
t�|�S)N)�getattr)�self�name)�outrr�__getattr__[sz,_gettextwriter.<locals>._wrapper.__getattr__N)�__name__�
__module__�__qualname__�	__class__r!r)r rr�_wrapperYs	r&cSsdS)Nrrrrr�<lambda>^sz _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrrr'cs�encoding�errors�xmlcharrefreplace�newliner�
write_throughT)�sys�stdout�
isinstance�io�
TextIOBase�codecs�StreamWriter�StreamReaderWriter�	RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError�
TextIOWrapper)r r(r-r&�bufferr)r r�_gettextwriterHs.	
r?c@s�eZdZddddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) �XMLGeneratorNz
iso-8859-1FcCs{tjj|�t||�}|j|_|j|_ig|_|jd|_	g|_
||_||_d|_
dS)NrF���)r�ContentHandler�__init__r?r9�_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps�	_encoding�_short_empty_elements�_pending_start_element)rr r(Zshort_empty_elementsrrrrCss			zXMLGenerator.__init__cCsU|drMd|dkr&d|dS|j|d}|rM|d|dS|dS)Nrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rH)rr�prefixrrr�_qnames
zXMLGenerator._qnamecCs#|jr|jd�d|_dS)NrF)rLrD)r�
endElementrrr�_finish_pending_start_element�s	
z*XMLGenerator._finish_pending_start_elementcCs|jd|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rDrJ)rrrr�
startDocument�s	zXMLGenerator.startDocumentcCs|j�dS)N)rF)rrrr�endDocument�szXMLGenerator.endDocumentcCs@|jj|jj��||j|<|jj||f�dS)N)rG�appendrHrrI)rrN�urirrr�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrrArA)rGrH)rrNrrr�endPrefixMapping�szXMLGenerator.endPrefixMappingcCs{|j�|jd|�x7|j�D])\}}|jd|t|�f�q(W|jrjd|_n
|jd�dS)Nrz %s=%sTr)rQrDrrrKrL)rr�attrsr
rrr�startElement�s
!	zXMLGenerator.startElementcCs7|jr"|jd�d|_n|jd|�dS)Nz/>Fz</%s>)rLrD)rrrrrrP�s	
zXMLGenerator.endElementcCs�|j�|jd|j|��xH|jD]=\}}|rZ|jd||f�q.|jd|�q.Wg|_x@|j�D]2\}}|jd|j|�t|�f�q�W|jr�d|_n
|jd�dS)Nrz xmlns:%s="%s"z xmlns="%s"z %s=%sTr)rQrDrOrIrrrKrL)rr�qnamerXrNrUr
rrr�startElementNS�s
	*	zXMLGenerator.startElementNScCs@|jr"|jd�d|_n|jd|j|��dS)Nz/>Fz</%s>)rLrDrO)rrrZrrr�endElementNS�s	
zXMLGenerator.endElementNScCsH|rD|j�t|t�s1t||j�}|jt|��dS)N)rQr/�strrJrDr)r�contentrrr�
characters�s

zXMLGenerator.characterscCsB|r>|j�t|t�s1t||j�}|j|�dS)N)rQr/r]rJrD)rr^rrr�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs%|j�|jd||f�dS)Nz	<?%s %s?>)rQrD)r�targetrrrr�processingInstruction�s
z"XMLGenerator.processingInstruction)r"r#r$rCrOrQrRrSrVrWrYrPr[r\r_r`rbrrrrr@qs
r@c@sceZdZddd�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):�
XMLFilterBaseNcCstjj|�||_dS)N)r�	XMLReaderrC�_parent)r�parentrrrrC�szXMLFilterBase.__init__cCs|jj|�dS)N)�_err_handler�error)r�	exceptionrrrrh�szXMLFilterBase.errorcCs|jj|�dS)N)rg�
fatalError)rrirrrrj�szXMLFilterBase.fatalErrorcCs|jj|�dS)N)rg�warning)rrirrrrk�szXMLFilterBase.warningcCs|jj|�dS)N)�
_cont_handler�setDocumentLocator)rZlocatorrrrrm�sz XMLFilterBase.setDocumentLocatorcCs|jj�dS)N)rlrR)rrrrrRszXMLFilterBase.startDocumentcCs|jj�dS)N)rlrS)rrrrrSszXMLFilterBase.endDocumentcCs|jj||�dS)N)rlrV)rrNrUrrrrVsz XMLFilterBase.startPrefixMappingcCs|jj|�dS)N)rlrW)rrNrrrrW	szXMLFilterBase.endPrefixMappingcCs|jj||�dS)N)rlrY)rrrXrrrrYszXMLFilterBase.startElementcCs|jj|�dS)N)rlrP)rrrrrrPszXMLFilterBase.endElementcCs|jj|||�dS)N)rlr[)rrrZrXrrrr[szXMLFilterBase.startElementNScCs|jj||�dS)N)rlr\)rrrZrrrr\szXMLFilterBase.endElementNScCs|jj|�dS)N)rlr_)rr^rrrr_szXMLFilterBase.characterscCs|jj|�dS)N)rlr`)r�charsrrrr`sz!XMLFilterBase.ignorableWhitespacecCs|jj||�dS)N)rlrb)rrarrrrrbsz#XMLFilterBase.processingInstructioncCs|jj|�dS)N)rl�
skippedEntity)rrrrrro!szXMLFilterBase.skippedEntitycCs|jj|||�dS)N)�_dtd_handler�notationDecl)rr�publicId�systemIdrrrrq&szXMLFilterBase.notationDeclcCs|jj||||�dS)N)rp�unparsedEntityDecl)rrrrrsZndatarrrrt)sz XMLFilterBase.unparsedEntityDeclcCs|jj||�S)N)Z_ent_handler�
resolveEntity)rrrrsrrrru.szXMLFilterBase.resolveEntitycCsT|jj|�|jj|�|jj|�|jj|�|jj|�dS)N)reZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r�sourcerrrrv3s
zXMLFilterBase.parsecCs|jj|�dS)N)re�	setLocale)r�localerrrrx:szXMLFilterBase.setLocalecCs|jj|�S)N)re�
getFeature)rrrrrrz=szXMLFilterBase.getFeaturecCs|jj||�dS)N)re�
setFeature)rr�staterrrr{@szXMLFilterBase.setFeaturecCs|jj|�S)N)re�getProperty)rrrrrr}CszXMLFilterBase.getPropertycCs|jj||�dS)N)re�setProperty)rrr
rrrr~FszXMLFilterBase.setPropertycCs|jS)N)re)rrrr�	getParentKszXMLFilterBase.getParentcCs
||_dS)N)re)rrfrrr�	setParentNszXMLFilterBase.setParent)r"r#r$rCrhrjrkrmrRrSrVrWrYrPr[r\r_r`rbrorqrtrurvrxrzr{r}r~rr�rrrrrc�s8rc�cCs�t|t�r!tj|�}n�t|d�r�|}tj�}t|jd�t�rj|j|�n
|j|�t|d�r�t|jt�r�|j	|j�|j
�dkr}|j�dkr}|j�}t
jjt
jj|��}t
jj||�}t
jj|�r<|j	|�t|d�}n4|j	tjj||��tjj|j��}|j|�|S)N�readrr�rb)r/r]rZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamrZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�os�path�dirname�normpath�join�isfile�open�urllibrvZurljoinZrequest�urlopen)rw�base�fZsysidZbaseheadZ
sysidfilenamerrr�prepare_input_sourceSs*
!$

r�)r�Zurllib.parser�Zurllib.requestr0r2r�rrr
rrrr?rBr@rdrcr�rrrr�<module>s$)so

Hacked By AnonymousFox1.0, Coded By AnonymousFox