Viewing File: /opt/alt/python35/lib64/python3.5/encodings/__pycache__/idna.cpython-35.opt-2.pyc



]#@sddlZddlZddlZddlmZejdZdZdZddZ	dd	Z
d
dZGdd
d
ejZGdddej
ZGdddejZGdddeejZGdddeejZddZdS)N)	ucd_3_2_0u[.。.。]sxn--zxn--cCs}g}x6|D].}tj|r%q
|jtj|q
Wdj|}tjd|}x|D]}tj|stj|stj	|stj
|stj|stj|stj
|stj|stj|rgtd|qgWdd|D}x[|D]S}|r"tdd|DrStd|d	si|dr"tdq"W|S)
NZNFKCzInvalid character %rcSsg|]}tj|qS)
stringprepZin_table_d1).0xrr)/opt/alt/python35/lib64/python3.5/idna.py
<listcomp>)s	znameprep.<locals>.<listcomp>css|]}tj|VqdS)N)rZin_table_d2)rrrrr	<genexpr>2sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2rzViolation of BIDI requirement 3)rZin_table_b1appendZmap_table_b2joinunicodedata	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9UnicodeErrorany)labelZnewlabelcZRandALrrrnamepreps4


rcCs*y|jd}Wntk
r'Yn3Xdt|koEdknrN|Stdt|}y|jd}Wntk
rYn3Xdt|kodknr|Std|jtrtd|jd}t|}dt|kodknr|StddS)Nasciir@zlabel empty or too longzLabel starts with ACE prefixpunycode)encoderlenr
startswithsace_prefix
ace_prefix)rrrrToASCII>s,
"
"
"rcCst|trd}n4y|jd}d}Wntk
rKd}YnX|st|}y|jd}Wntk
rtdYnX|jtst|dS|ttd}|j	d}t
|}t|djt|dkrtd|||S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)
isinstancebytesrrrrrstrrdecoderlower)rZ
pure_asciiZlabel1resultZlabel2rrr	ToUnicodeis*	



$r%c@s.eZdZdddZdddZdS)CodecstrictcCsh|dkrtd||s&dSy|jd}Wntk
rMYnX|jd}xF|ddD]4}dt|kodknsntd	qnWt|d
dkrtd
|t|fSt}tj|}|r|drd}|d=nd}x4|D],}|r7|jd|jt|qWt	||t|fS)Nr'zunsupported error handling rr.rrzlabel empty or too longzlabel too long)r(rrrrr)
rrUnicodeEncodeErrorsplitr	bytearraydotsextendrr )selfinputerrorsr$labelsrtrailing_dotrrrrs4
"	


zCodec.encodecCs|dkrtd||s&d	St|tsAt|}t|kry|jdt|fSWntk
r~YnX|jd}|rt|d
dkrd}|d=nd}g}x!|D]}|jt	|qWdj
||t|fS)Nr'zUnsupported error handling rrrr)r.)rrrr)rrr rr"rUnicodeDecodeErrorr+r
r%r)r/r0r1r2r3r$rrrrr"s(


zCodec.decodeN)__name__
__module____qualname__rr"rrrrr&s%r&c@seZdZddZdS)IncrementalEncoderc	Cs|dkrtd||s&dStj|}d}|rt|ds[d}|d	=n|st|d
=|rtd}t}d}xN|D]F}|r|jd|d7}|jt||t|7}qW||7}|t|7}t||fS)Nr'zunsupported error handling r(rrr))r(rrrr)rr-r+r,r.rrr )	r/r0r1finalr2r3r$sizerrrr_buffer_encodes2

	



z!IncrementalEncoder._buffer_encodeN)r6r7r8r<rrrrr9sr9c@seZdZddZdS)IncrementalDecoderc	Cs!|dkrtd||s&dSt|trGtj|}nt|d}|jd}d}|r|d	sd}|d
=n|s|d=|rd}g}d}xA|D]9}|jt||r|d7}|t|7}qWdj||}|t|7}||fS)Nr'zUnsupported error handling rrrr4r)rrrrr)	rrr!r-r+r
r%rr)	r/r0r1r:r2r3r$r;rrrr_buffer_decodes6



z!IncrementalDecoder._buffer_decodeN)r6r7r8r>rrrrr=sr=c@seZdZdS)StreamWriterN)r6r7r8rrrrr?$sr?c@seZdZdS)StreamReaderN)r6r7r8rrrrr@'sr@cCs@tjdddtjdtjdtdtdtdtS)	NnameZidnarr"incrementalencoderincrementaldecoderstreamwriterstreamreader)	codecs	CodecInfor&rr"r9r=r?r@rrrrgetregentry,s	rH)rrerFrrcompiler-rrrrr%r&BufferedIncrementalEncoderr9BufferedIncrementalDecoderr=r?r@rHrrrr<module>s$0+)H#'
Back to Directory File Manager