Hacked By AnonymousFox

Current Path : /lib/python2.7/site-packages/pip/_vendor/idna/
Upload File :
Current File : //lib/python2.7/site-packages/pip/_vendor/idna/core.pyo

�
��abc@s�ddlmZddlZddlZddlZddlZddlmZdZdZ	ej
d�Zejdd	kr�e
ZeZnd
efd��YZdefd
��YZdefd��YZdefd��YZd�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�Z d�Z!ed�Z"d�Z#d�Z$d �Z%e&ed!�Z'eeeed"�Z(eeed#�Z)dS($i(tidnadatai����N(tintranges_containi	sxn--u[.。.。]iit	IDNAErrorcBseZdZRS(s7 Base exception for all IDNA-encoding related problems (t__name__t
__module__t__doc__(((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyRst
IDNABidiErrorcBseZdZRS(s= Exception when bidirectional requirements are not satisfied (RRR(((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyRstInvalidCodepointcBseZdZRS(s> Exception when a disallowed or unallocated codepoint is used (RRR(((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyRstInvalidCodepointContextcBseZdZRS(sE Exception when the codepoint is not valid in the context it is used (RRR(((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyRscCstjt|��S(N(tunicodedatat	combiningtunichr(tcp((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt_combining_class$scCstt|�tj|�S(N(RtordRtscripts(Rtscript((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt
_is_script'scCs
|jd�S(Ntpunycode(tencode(ts((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt	_punycode*scCs
dj|�S(Ns	U+{0:04X}(tformat(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt_unot-scCst|�dkrtStS(Ni?(tlentFalsetTrue(tlabel((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytvalid_label_length1scCs&t|�|rdndkr"tStS(Ni�i�(RRR(Rttrailing_dot((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytvalid_string_length8sc	Cst}xot|d�D]^\}}tj|�}|dkr^tdjt|�|���n|dkrt}PqqW|r�|r�tStj|d�}|dkr�t}n0|dkr�t}ntd	jt|����t}t}x
t|d�D]�\}}tj|�}|r�|dkrCtdj|���n|dkrXt}n|dkrmt}n|dkr�|s�|}q�||kr�td��q�q�q�|dkr�tdj|���n|dkr�t}q�|dkr�t}q�q�W|std��ntS(Nits3Unknown directionality in label {0} at position {1}tRtALtANitLs>First codepoint in label {0} must be directionality L, R or ALtENtEStCStETtONtBNtNSMsHInvalid direction for codepoint at position {0} in a right-to-left labels2Can not mix numeral types in a right-to-left labelsHInvalid direction for codepoint at position {0} in a left-to-right labels0Label ends with illegal codepoint directionality(R R!R"(R R!(
R R!R"R$R%R&R'R(R)R*(R R!R$R"(R"R$(R#R$R%R&R'R(R)R*(R#R$(Rt	enumerateR	t
bidirectionalRRtreprR(	Rt	check_ltrt
bidi_labeltidxRt	directiontrtltvalid_endingtnumber_type((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt
check_bidi?sR!						
cCs0tj|d�ddkr,td��ntS(NitMs0Label begins with an illegal combining character(R	tcategoryRR(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytcheck_initial_combiner|scCsU|dd!dkr"td��n|ddksB|ddkrQtd��ntS(	Niis--s4Label has disallowed hyphens in 3rd and 4th positionit-i����s)Label must not start or end with a hyphen(RR(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytcheck_hyphen_ok�s
 cCs+tjd|�|kr'td��ndS(NtNFCs%Label must be in Normalization Form C(R	t	normalizeR(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt	check_nfc�scCs�t||�}|dkrf|dkrOtt||d��tkrOtSnt}xzt|ddd�D]b}tjjt||��}|td�kr�qln|td�td�gkrlt}PqlqlW|s�tSt}x}t|dt	|��D]b}tjjt||��}|td�kr6q�n|td�td�gkr�t}Pq�q�W|S|d	kr�|dkr�tt||d��tkr�tSntStSdS(
Ni iii����tTR#tDR i
 (
RR
t_virama_combining_classRRtrangeRt
joining_typestgetR(Rtpostcp_valuetoktitjoining_type((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytvalid_contextj�s<   cCs!t||�}|dkr�d|ko=t|�dknr}t||d�dkr}t||d�dkr}tSntS|dkr�|t|�dkr�t|�dkr�t||dd�StS|dks�|dkr|dkrt||dd	�StS|d
kroxQ|D]I}|dkr6qnt|d�sct|d
�sct|d�rtSqWtSd|ko�dknr�x4|D],}dt|�ko�dknr�tSq�WtSd|ko�dknrx4|D],}dt|�kodknr�tSq�WtSdS(Ni�iiiliutGreeki�i�tHebrewi�0u・tHiraganatKatakanatHani`iii�i�(RRRRR(RRDt	exceptionRER((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytvalid_contexto�s>&4(
-
"
"cCs�t|ttf�r'|jd�}nt|�dkrHtd��nt|�t|�t|�xt	|�D]\}}t
|�}t|tj
d�r�qsqst|tj
d�r�t||�s~tdjt|�|dt|����q~qst|tj
d�rSt||�s~td	jt|�|dt|����q~qstd
jt|�|dt|����qsWt|�dS(Nsutf-8isEmpty LabeltPVALIDtCONTEXTJs-Joiner {0} not allowed at position {1} in {2}itCONTEXTOs0Codepoint {0} not allowed at position {1} in {2}s0Codepoint {0} at position {1} of {2} not allowed(t
isinstancetbytest	bytearraytdecodeRRR=R:R8R+RRRtcodepoint_classesRIRRRR-RPRR5(RRDRRE((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytcheck_label�s&


11/cCs�yi|jd�}yt|�Wn&tk
rHtdj|���nXt|�sdtd��n|SWntk
r|nX|s�td��nt|�}t|�t|�}t	|}t|�s�td��n|S(Ntasciis$The label {0} is not a valid A-labelsLabel too longsNo Input(
RtulabelRRRtUnicodeEncodeErrortunicodeRYRt_alabel_prefix(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytalabels(



cCs�t|ttf�sJy|jd�}WqJtk
rFt|�|SXn|j�}|jt�rx|t	t�}nt|�|j
d�S|j
d�}t|�|S(NRZR(RTRURVRR\RYtlowert
startswithR^RRW(R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyR[s




cCs�ddlm}d}yFx/t|�D]!\}}t|�}||dkrS|ntj||df�d}|d}	t|�dkr�|dnd}
|	dks�|	d	kr�|s�|	d
kr�|r�|
dkr�||7}q&|
dk	r/|	dks"|	d
kr|s"|	d	kr/|r/||
7}q&|	dkr&t��q&q&Wtj	d
|�SWn<tk
r�t
djt|�|dt
|����nXdS(sBRe-map the characters in the string according to UTS46 processing.i(t	uts46datauitZiitVR?t3R6tIR;s0Codepoint {0} not allowed at position {1} in {2}N(RbR+Rtbisecttbisect_leftRtNonet
IndexErrorR	R<RRRR-(tdomaint
std3_rulesttransitionalRbtoutputRDtchart
code_pointtuts46rowtstatustreplacement((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pytuts46_remap3s0
"


c	Cs4t|ttf�r'|jd�}n|rBt|||�}nt}g}|rf|jd�}ntj|�}x|r�|dr�|d=qxW|s�td��n|ddkr�|d=t	}nx!|D]}|j
t|��q�W|r|j
d�ndj|�}t
||�s0td��n|S(NRZt.isEmpty domaini����RsDomain too long(RTRURVRWRtRtsplitt_unicode_dots_reRRtappendR_tjoinR(	Rtstricttuts46RlRmRtresulttlabelsR((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyROs0	
cCs
t|ttf�r'|jd�}n|rBt||t�}nt}g}|sftj|�}n|jd�}x|r�|dr�|d=qxW|s�td��n|ds�|d=t	}nx!|D]}|j
t|��q�W|r�|j
d�ndj|�S(NRZu.isEmpty domaini����u(
RTRURVRWRtRRwRvRRRxR[Ry(RRzR{RlRR|R}R((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyRWls*
	
(*RRRgR	tretsyst	intrangesRR@R^tcompileRwtversion_infotstrR]tchrRtUnicodeErrorRRRRR
RRRRRRR5R8R:R=RIRPRYR_R[RRtRRW(((s9/usr/lib/python2.7/site-packages/pip/_vendor/idna/core.pyt<module>sB							=					,)			

Hacked By AnonymousFox1.0, Coded By AnonymousFox