3

Y'íc.
ã@s¸ddlmZmZmZmZmZddlZddlZddlm	Z	m
Z
ejdƒZGdd„dej
ƒZ
Gdd	„d	ejƒZGd
d„dejƒZGdd
„d
e
ejƒZGdd„de
ejƒZejdœdd„ZdS)é)ÚencodeÚdecodeÚalabelÚulabelÚ	IDNAErroréN)ÚTupleÚOptionalu[.。.。]c@sDeZdZdeeeeefdœdd„Zd	eeeeefdœdd„ZdS)
ÚCodecÚstrict)ÚdataÚerrorsÚreturncCs.|dkrtdj|ƒƒ‚|sdSt|ƒt|ƒfS)NrzUnsupported error handling "{}"ór)rr)rÚformatrÚlen)Úselfrr
©rú*/tmp/pip-build-gk9425m9/idna/idna/codec.pyr
s
zCodec.encodecCs.|dkrtdj|ƒƒ‚|sdSt|ƒt|ƒfS)NrzUnsupported error handling "{}"Úr)rr)rrrr)rrr
rrrrs
zCodec.decodeN)r)r)	Ú__name__Ú
__module__Ú__qualname__ÚstrrÚbytesÚintrrrrrrr
s	r
c@s(eZdZeeeeeefdœdd„ZdS)ÚIncrementalEncoder)rr
Úfinalrc
Cs´|dkrtdj|ƒƒ‚|sdStj|ƒ}d}|rV|dsDd}|d	=n|sV|d
=|rVd}g}d}x2|D]*}|jt|ƒƒ|r‚|d7}|t|ƒ7}qdWdj|ƒ|}	|t|ƒ7}|	|fS)NrzUnsupported error handling "{}"rrrÚ.)rréÿÿÿÿrr)rrÚ_unicode_dots_reÚsplitÚappendrrÚjoin)
rrr
rÚlabelsÚtrailing_dotÚresultÚsizeÚlabelÚ
result_strrrrÚ_buffer_encodes0

z!IncrementalEncoder._buffer_encodeN)rrrrÚboolrrr*rrrrrsrc@s(eZdZeeeeeefdœdd„ZdS)ÚIncrementalDecoder)rr
rrc
Cs´|dkrtdj|ƒƒ‚|sdStj|ƒ}d}|rV|dsDd}|d	=n|sV|d
=|rVd}g}d}x2|D]*}|jt|ƒƒ|r‚|d7}|t|ƒ7}qdWdj|ƒ|}	|t|ƒ7}|	|fS)NrzUnsupported error handling "{}"rrrr)rrrrr)rrr r!r"rrr#)
rrr
rr$r%r&r'r(r)rrrÚ_buffer_decode>s0

z!IncrementalDecoder._buffer_decodeN)rrrrr+rrr-rrrrr,=sr,c@seZdZdS)ÚStreamWriterN)rrrrrrrr.^sr.c@seZdZdS)ÚStreamReaderN)rrrrrrrr/bsr/)rc	Cs tjdtƒjtƒjttttdS)NÚidna)ÚnamerrÚincrementalencoderÚincrementaldecoderÚstreamwriterÚstreamreader)	ÚcodecsÚ	CodecInfor
rrrr,r.r/rrrrÚgetregentryfsr8)Úcorerrrrrr6ÚreÚtypingrr	Úcompiler r
ÚBufferedIncrementalEncoderrÚBufferedIncrementalDecoderr,r.r/r7r8rrrrÚ<module>s
!!