Viewing File: /usr/lib/python2.7/site-packages/idna/core.pyc

ó
?†ic@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__(((s-/usr/lib/python2.7/site-packages/idna/core.pyRst
IDNABidiErrorcBseZdZRS(s= Exception when bidirectional requirements are not satisfied (RRR(((s-/usr/lib/python2.7/site-packages/idna/core.pyRstInvalidCodepointcBseZdZRS(s> Exception when a disallowed or unallocated codepoint is used (RRR(((s-/usr/lib/python2.7/site-packages/idna/core.pyRstInvalidCodepointContextcBseZdZRS(sE Exception when the codepoint is not valid in the context it is used (RRR(((s-/usr/lib/python2.7/site-packages/idna/core.pyRscCstjt|ƒƒS(N(tunicodedatat	combiningtunichr(tcp((s-/usr/lib/python2.7/site-packages/idna/core.pyt_combining_class$scCstt|ƒtj|ƒS(N(RtordRtscripts(Rtscript((s-/usr/lib/python2.7/site-packages/idna/core.pyt
_is_script'scCs
|jdƒS(Ntpunycode(tencode(ts((s-/usr/lib/python2.7/site-packages/idna/core.pyt	_punycode*scCs
dj|ƒS(Ns	U+{0:04X}(tformat(R((s-/usr/lib/python2.7/site-packages/idna/core.pyt_unot-scCst|ƒdkrtStS(Ni?(tlentFalsetTrue(tlabel((s-/usr/lib/python2.7/site-packages/idna/core.pytvalid_label_length1scCs&t|ƒ|rdndkr"tStS(Niţiý(RRR(Rttrailing_dot((s-/usr/lib/python2.7/site-packages/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((s-/usr/lib/python2.7/site-packages/idna/core.pyt
check_bidi?sR!						
cCs0tj|dƒddkr,tdƒ‚ntS(NitMs0Label begins with an illegal combining character(R	tcategoryRR(R((s-/usr/lib/python2.7/site-packages/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((s-/usr/lib/python2.7/site-packages/idna/core.pytcheck_hyphen_okƒs
 cCs+tjd|ƒ|kr'tdƒ‚ndS(NtNFCs%Label must be in Normalization Form C(R	t	normalizeR(R((s-/usr/lib/python2.7/site-packages/idna/core.pyt	check_nfcŒscCsƒt||ƒ}|dkr8|dkrOtt||dƒƒtkrOtSnt}xct|dddƒD]K}tjjt||ƒƒ}|dkr qlql|d
krśt}PqlPqlW|sĹtSt}xft|dt	|ƒƒD]K}tjjt||ƒƒ}|dkrqĺqĺ|dkr/t}PqĺPqĺW|S|d	kr{|dkrwtt||dƒƒtkrwtSntStSdS(Ni iii˙˙˙˙tTR#tDR i
 (R#R?(R R?(
RR
t_virama_combining_classRRtrangeRt
joining_typestgetR(Rtpostcp_valuetoktitjoining_type((s-/usr/lib/python2.7/site-packages/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
krrxT|D]L}|dkr6qnt|dƒrt|d
ƒrt|dƒrtSqWtSd|ko‰dknrÉx4|D],}dt|ƒko¸dknr•tSq•WtSd|koŕdknr x4|D],}dt|ƒkodknrětSqěWtSdS(NiˇiiiliutGreekióiôtHebrewiű0uポtHiraganatKatakanatHani`iiiđiů(RRRRR(RRDt	exceptionRER((s-/usr/lib/python2.7/site-packages/idna/core.pytvalid_contextoÂs>&4(
0
"
"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((s-/usr/lib/python2.7/site-packages/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((s-/usr/lib/python2.7/site-packages/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((s-/usr/lib/python2.7/site-packages/idna/core.pyR["s




c
CsŸ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((s-/usr/lib/python2.7/site-packages/idna/core.pytuts46_remap7s0
"


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((s-/usr/lib/python2.7/site-packages/idna/core.pyRSs0	
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((s-/usr/lib/python2.7/site-packages/idna/core.pyRWps*
	
(*RRRgR	tretsyst	intrangesRR@R^tcompileRwtversion_infotstrR]tchrRtUnicodeErrorRRRRR
RRRRRRR5R8R:R=RIRPRYR_R[RRtRRW(((s-/usr/lib/python2.7/site-packages/idna/core.pyt<module>sB							=					0)			
Back to Directory File Manager