Your IP : 3.14.247.170


Current Path : /opt/alt/python34/lib64/python3.4/encodings/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/encodings/__pycache__/idna.cpython-34.pyo

�
j f�#�@sddlZddlZddlZddlmZejd�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}x9|D]1}tj|�r(q
n|jtj|��q
Wdj|�}tjd|�}x�|D]�}tj|�s�tj|�s�tj	|�s�tj
|�s�tj|�s�tj|�s�tj
|�s�tj|�s�tj|�rjtd|��qjqjWdd�|D�}xd|D]\}|r(tdd�|D��r\td��n|d	sr|dr�td��q�q(q(W|S)
N�ZNFKCzInvalid character %rcSsg|]}tj|��qS�)�
stringprepZin_table_d1)�.0�xrr�3/opt/alt/python34/lib64/python3.4/encodings/idna.py�
<listcomp>)s	znameprep.<locals>.<listcomp>css|]}tj|�VqdS)N)rZin_table_d2)rrrrr�	<genexpr>2sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r�zViolation of BIDI requirement 3���)rZin_table_b1�appendZmap_table_b2�join�unicodedataZ	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr�namepreps4


rcCs-y|jd�}Wntk
r'Yn3Xdt|�koEdknrN|Std��t|�}y|jd�}Wntk
r�Yn3Xdt|�ko�dknr�|Std��|jt�r�td��n|jd�}t|}dt|�kodknr|Std��dS)N�asciir�@zlabel empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr�ToASCII>s,
"
"
"rcCst|t�rd}n4y|jd�}d}Wntk
rKd}YnX|s�t|�}y|jd�}Wq�tk
r�td��Yq�Xn|jt�s�t|d�S|tt�d�}|j	d�}t
|�}t|d�j�t|d�krtd||��n|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrrrr�strr�decoder�lower)rZ
pure_asciiZlabel1�resultZlabel2rrr�	ToUnicodeis*	



$r$c@s.eZdZddd�Zddd�ZdS)�Codec�strictcCst|dkrtd|��n|s)dSy|jd�}Wntk
rPYn�X|jd�}xI|dd�D]7}dt|�ko�dknsqtd	��qqqqWt|d
�dkr�td
��n|t|�fSt�}tj|�}|r|drd}|d=nd}x7|D]/}|rC|jd�n|jt|��q'Wt	||�t|�fS)Nr&zunsupported error handling �rr�.rrzlabel empty or too longzlabel too long)r'rrrrr)
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendrr)�self�input�errorsr#�labelsr�trailing_dotrrrr�s4
"	

zCodec.encodecCs|dkrtd|��n|s)d	St|t�sGt|�}nt|kr�y|jd�t|�fSWq�tk
r�Yq�Xn|jd�}|r�t|d
�dkr�d}|d=nd}g}x!|D]}|jt	|��q�Wdj
|�|t|�fS)Nr&zUnsupported error handling rrrr(r�.)rrrr)rrrrr!r�UnicodeDecodeErrorr*r
r$r)r.r/r0r1r2r#rrrrr!�s(


zCodec.decodeN)�__name__�
__module__�__qualname__rr!rrrrr%�s%r%c@seZdZdd�ZdS)�IncrementalEncoderc	Cs
|dkrtd|��n|s)dStj|�}d}|r�|ds^d}|d	=q�|s�|d
=|r}d}q}q�nt�}d}xQ|D]I}|r�|jd�|d7}n|jt|��|t|�7}q�W||7}|t|�7}t|�|fS)Nr&zunsupported error handling r'rrr()r'rrrr)rr,r*r+r-rrr)	r.r/r0�finalr1r2r#�sizerrrr�_buffer_encode�s2

	



z!IncrementalEncoder._buffer_encodeN)r5r6r7r;rrrrr8�sr8c@seZdZdd�ZdS)�IncrementalDecoderc	Cs0|dkrtd|��n|s)dSt|t�rJtj|�}nt|d�}|jd�}d}|r�|d	s�d}|d
=q�|s�|d=|r�d}q�q�ng}d}xD|D]<}|jt|��|r�|d7}n|t|�7}q�Wdj|�|}|t|�7}||fS)Nr&zUnsupported error handling rrrr3r)rrrrr)	rrr r,r*r
r$rr)	r.r/r0r9r1r2r#r:rrrr�_buffer_decode�s6



z!IncrementalDecoder._buffer_decodeN)r5r6r7r=rrrrr<�sr<c@seZdZdS)�StreamWriterN)r5r6r7rrrrr>$sr>c@seZdZdS)�StreamReaderN)r5r6r7rrrrr?'sr?cCs@tjdddt�jdt�jdtdtdtdt�S)	N�nameZidnarr!�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor%rr!r8r<r>r?rrrr�getregentry,s	rG)r�rerErr�compiler,rrrrr$r%�BufferedIncrementalEncoderr8�BufferedIncrementalDecoderr<r>r?rGrrrr�<module>s$0+)H#'

?>