ok

Mini Shell

Direktori : /proc/self/root/lib64/python3.6/xml/sax/__pycache__/
Upload File :
Current File : //proc/self/root/lib64/python3.6/xml/sax/__pycache__/saxutils.cpython-36.opt-2.pyc

3


 \�/�@s�ddlZddlZddlZddlZddlZddlmZddlmZdd�Z	ifdd�Z
ifd	d
�Zifdd�Zd
d�Z
Gdd�dej�ZGdd�dej�Zddd�ZdS)�N�)�handler)�	xmlreadercCs&x |j�D]\}}|j||�}q
W|S)N)�items�replace)�s�d�key�value�r�(/usr/lib64/python3.6/xml/sax/saxutils.py�__dict_replacesr
cCs6|jdd�}|jdd�}|jdd�}|r2t||�}|S)N�&z&amp;�>z&gt;�<z&lt;)rr
)�data�entitiesrrr�escapes	
rcCs2|jdd�}|jdd�}|r&t||�}|jdd�S)Nz&lt;rz&gt;rz&amp;r)rr
)rrrrr�unescape"s

rcCs\|j�}|jdddd��t||�}d|krPd|krFd|jdd�}qXd	|}nd|}|S)
Nz&#10;z&#13;z&#9;)�
�
�	�"�'z"%s"z&quot;z'%s')�copy�updaterr)rrrrr�	quoteattr0s

rcs��dkrddl}|jSt�tj�r&�St�tjtjf�r<�St�tj�rlG�fdd�d�}|�}dd�|_	nDtj
�}dd�|_�j|_y�j
|_
�j|_Wntk
r�YnXtj||ddd	d
�S)NrcseZdZ�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�_wrapperYsr&cSsdS)Nrrrrr�<lambda>^sz _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrrr'cs�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)r-r&�bufferr)r r�_gettextwriterHs.
r?c@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-1FcCsVtjj|�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rDss
zXMLGenerator.__init__cCsJ|drBd|dkr d|dS|j|d}|rB|d|dS|dS)Nrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rI)rr�prefixrrr�_qnameszXMLGenerator._qnamecCs|jr|jd�d|_dS)NrF)rMrE)r�
endElementrrr�_finish_pending_start_element�s
z*XMLGenerator._finish_pending_start_elementcCs|jd|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rErK)rrrr�
startDocument�szXMLGenerator.startDocumentcCs|j�dS)N)rG)rrrr�endDocument�szXMLGenerator.endDocumentcCs0|jj|jj��||j|<|jj||f�dS)N)rH�appendrIrrJ)rrO�urirrr�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrrBrB)rHrI)rrOrrr�endPrefixMapping�szXMLGenerator.endPrefixMappingcCs^|j�|jd|�x*|j�D]\}}|jd|t|�f�q W|jrPd|_n
|jd�dS)Nrz %s=%sTr)rRrErrrLrM)rr�attrsr
rrr�startElement�szXMLGenerator.startElementcCs*|jr|jd�d|_n|jd|�dS)Nz/>Fz</%s>)rMrE)rrrrrrQ�s
zXMLGenerator.endElementcCs�|j�|jd|j|��x8|jD].\}}|rD|jd||f�q$|jd|�q$Wg|_x0|j�D]$\}}|jd|j|�t|�f�qfW|jr�d|_n
|jd�dS)Nrz xmlns:%s="%s"z xmlns="%s"z %s=%sTr)rRrErPrJrrrLrM)rr�qnamerYrOrVr
rrr�startElementNS�s zXMLGenerator.startElementNScCs0|jr|jd�d|_n|jd|j|��dS)Nz/>Fz</%s>)rMrErP)rrr[rrr�endElementNS�s
zXMLGenerator.endElementNScCs4|r0|j�t|t�s"t||j�}|jt|��dS)N)rRr/�strrKrEr)r�contentrrr�
characters�s

zXMLGenerator.characterscCs0|r,|j�t|t�s"t||j�}|j|�dS)N)rRr/r^rKrE)rr_rrr�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs|j�|jd||f�dS)Nz	<?%s %s?>)rRrE)r�targetrrrr�processingInstruction�sz"XMLGenerator.processingInstruction)NrAF)F)r"r#r$rDrPrRrSrTrWrXrZrQr\r]r`rarcrrrrr@qs


r@c@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);�
XMLFilterBaseNcCstjj|�||_dS)N)r�	XMLReaderrD�_parent)r�parentrrrrD�szXMLFilterBase.__init__cCs|jj|�dS)N)�_err_handler�error)r�	exceptionrrrri�szXMLFilterBase.errorcCs|jj|�dS)N)rh�
fatalError)rrjrrrrk�szXMLFilterBase.fatalErrorcCs|jj|�dS)N)rh�warning)rrjrrrrl�szXMLFilterBase.warningcCs|jj|�dS)N)�
_cont_handler�setDocumentLocator)rZlocatorrrrrn�sz XMLFilterBase.setDocumentLocatorcCs|jj�dS)N)rmrS)rrrrrSszXMLFilterBase.startDocumentcCs|jj�dS)N)rmrT)rrrrrTszXMLFilterBase.endDocumentcCs|jj||�dS)N)rmrW)rrOrVrrrrWsz XMLFilterBase.startPrefixMappingcCs|jj|�dS)N)rmrX)rrOrrrrX	szXMLFilterBase.endPrefixMappingcCs|jj||�dS)N)rmrZ)rrrYrrrrZszXMLFilterBase.startElementcCs|jj|�dS)N)rmrQ)rrrrrrQszXMLFilterBase.endElementcCs|jj|||�dS)N)rmr\)rrr[rYrrrr\szXMLFilterBase.startElementNScCs|jj||�dS)N)rmr])rrr[rrrr]szXMLFilterBase.endElementNScCs|jj|�dS)N)rmr`)rr_rrrr`szXMLFilterBase.characterscCs|jj|�dS)N)rmra)r�charsrrrrasz!XMLFilterBase.ignorableWhitespacecCs|jj||�dS)N)rmrc)rrbrrrrrcsz#XMLFilterBase.processingInstructioncCs|jj|�dS)N)rm�
skippedEntity)rrrrrrp!szXMLFilterBase.skippedEntitycCs|jj|||�dS)N)�_dtd_handler�notationDecl)rr�publicId�systemIdrrrrr&szXMLFilterBase.notationDeclcCs|jj||||�dS)N)rq�unparsedEntityDecl)rrrsrtZndatarrrru)sz XMLFilterBase.unparsedEntityDeclcCs|jj||�S)N)Z_ent_handler�
resolveEntity)rrsrtrrrrv.szXMLFilterBase.resolveEntitycCs@|jj|�|jj|�|jj|�|jj|�|jj|�dS)N)rfZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r�sourcerrrrw3s
zXMLFilterBase.parsecCs|jj|�dS)N)rf�	setLocale)rZlocalerrrry:szXMLFilterBase.setLocalecCs|jj|�S)N)rf�
getFeature)rrrrrrz=szXMLFilterBase.getFeaturecCs|jj||�dS)N)rf�
setFeature)rr�staterrrr{@szXMLFilterBase.setFeaturecCs|jj|�S)N)rf�getProperty)rrrrrr}CszXMLFilterBase.getPropertycCs|jj||�dS)N)rf�setProperty)rrr
rrrr~FszXMLFilterBase.setPropertycCs|jS)N)rf)rrrr�	getParentKszXMLFilterBase.getParentcCs
||_dS)N)rf)rrgrrr�	setParentNszXMLFilterBase.setParent)N)r"r#r$rDrirkrlrnrSrTrWrXrZrQr\r]r`rarcrprrrurvrwryrzr{r}r~rr�rrrrrd�s8
rd�cCst|t�rtj|�}n^t|d�rt|}tj�}t|jd�t�rH|j|�n
|j|�t|d�rtt|jt�rt|j	|j�|j
�dko�|j�dk�r|j�}t
jjt
jj|��}t
jj||�}t
jj|�r�|j	|�t|d�}n$|j	tjj||��tjj|j��}|j|�|S)N�readrr�rb)r/r^rZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamrZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�os�path�dirname�normpath�join�isfile�open�urllibrwZurljoinZrequestZurlopen)rx�base�fZsysidZbaseheadZ
sysidfilenamerrr�prepare_input_sourceSs*




r�)r�)r�Zurllib.parser�Zurllib.requestr0r2r�rrr
rrrr?rCr@rerdr�rrrr�<module>s)so

Zerion Mini Shell 1.0