B ˆ fŠ#ã@s¸ddlZddlZddlZddlmZe d¡ZdZdZdd„Z dd „Z d d „Z Gd d „d ej ƒZ Gdd„dej ƒZGdd„dejƒZGdd„de ejƒZGdd„de ejƒZdd„ZdS)éN)Ú ucd_3_2_0u [.。.。]sxn--zxn--cCsg}x(|D] }t |¡rq | t |¡¡q Wd |¡}t d|¡}xr|D]j}t |¡s¨t |¡s¨t  |¡s¨t  |¡s¨t  |¡s¨t  |¡s¨t  |¡s¨t |¡s¨t |¡rJtd|ƒ‚qJWdd„|Dƒ}t|ƒ�rtdd„|Dƒƒrêtdƒ‚|d rü|d �std ƒ‚|S) NÚZNFKCzInvalid character %rcSsg|]}t |¡‘qS©)Ú stringprepZ in_table_d1)Ú.0Úxrrú3/opt/alt/python37/lib64/python3.7/encodings/idna.pyú )sznameprep..css|]}t |¡VqdS)N)rZ in_table_d2)rrrrrú 1sznameprep..zViolation of BIDI requirement 2réÿÿÿÿzViolation of BIDI requirement 3)rZ in_table_b1ÚappendZ map_table_b2ÚjoinÚ unicodedataZ normalizeZ in_table_c12Z in_table_c22Z in_table_c3Z in_table_c4Z in_table_c5Z in_table_c6Z in_table_c7Z in_table_c8Z in_table_c9Ú UnicodeErrorÚany)ÚlabelZnewlabelÚcZRandALrrrÚnamepreps2               rcCsðy| d¡}Wntk r"Yn*Xdt|ƒkrYnhX| d¡}x6|dd…D]&}dt|ƒkrtdksXntd ƒ‚qXWt|dƒdkrštd ƒ‚|t|ƒfStƒ}t |¡}|rÎ|dsÎd}|d=nd }x(|D] }|rê| d¡| t|ƒ¡qØWt ||ƒt|ƒfS) Nr%zunsupported error handling )órró.r rrzlabel empty or too longzlabel too longr&) rrÚUnicodeEncodeErrorÚsplitrÚ bytearrayÚdotsÚextendrr)ÚselfÚinputÚerrorsr"ÚlabelsrÚ trailing_dotrrrr‘s4        z Codec.encodecCsÂ|dkrtd|ƒ‚|sdSt|tƒs.t|ƒ}t|kr^y| d¡t|ƒfStk r\YnX| d¡}|rˆt|dƒdkrˆd}|d=nd }g}x|D]}| t |ƒ¡q–Wd  |¡|t|ƒfS) Nr%zUnsupported error handling )rrrr'r rÚ.r) rrrrr rÚUnicodeDecodeErrorr)r r#r )r-r.r/r0r1r"rrrrr ¶s(    z Codec.decodeN)r%)r%)Ú__name__Ú __module__Ú __qualname__rr rrrrr$�s %r$c@seZdZdd„ZdS)ÚIncrementalEncoderc Cs¼|dkrtd|ƒ‚|sdSt |¡}d}|rT|dsBd}|d=n|sT|d=|rTd}tƒ}d}x<|D]4}|r~| d¡|d7}| t|ƒ¡|t|ƒ7}qdW||7}|t|ƒ7}t|ƒ|fS) Nr%zunsupported error handling )r&rr&r r'ré)rr+r)r*r,rrr) r-r.r/Úfinalr0r1r"ÚsizerrrrÚ_buffer_encodeÙs2     z!IncrementalEncoder._buffer_encodeN)r4r5r6r;rrrrr7Øsr7c@seZdZdd„ZdS)ÚIncrementalDecoderc CsÒ|dkrtd|ƒ‚|sdSt|tƒr2t |¡}nt|dƒ}| d¡}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}x2|D]*}| t|ƒ¡|r |d 7}|t|ƒ7}q‚Wd |¡|}|t|ƒ7}||fS) Nr%zUnsupported error handling )rrrr2rr rr8) rrrr+r)r r#rr ) r-r.r/r9r0r1r"r:rrrrÚ_buffer_decodeüs6       z!IncrementalDecoder._buffer_decodeN)r4r5r6r=rrrrr<ûsr<c@s eZdZdS)Ú StreamWriterN)r4r5r6rrrrr>"sr>c@s eZdZdS)Ú StreamReaderN)r4r5r6rrrrr?%sr?c Cs tjdtƒjtƒjttttd�S)NZidna)Únamerr ÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreader) ÚcodecsÚ CodecInfor$rr r7r<r>r?rrrrÚ getregentry*srG)rÚrerErrÚcompiler+rrrrr#r$ÚBufferedIncrementalEncoderr7ÚBufferedIncrementalDecoderr<r>r?rGrrrrÚs  .+)H#'