VYã ã@sâddlmZmZmZmZmZddlZddlZejdƒZ Gdd„dej ƒZ Gdd„dej ƒZ Gd d „d ej ƒZGd d „d e ejƒZGd d„de ejƒZdd„ZdS)é)ÚencodeÚdecodeÚalabelÚulabelÚ IDNAErroréNu [.。.。]c@s.eZdZddd„Zddd„ZdS)ÚCodecÚstrictcCsA|dkr!tdj|ƒƒ‚|s+dSt|ƒt|ƒfS)Nr z Unsupported error handling "{0}"Úr)r r)rÚformatrÚlen)ÚselfÚdataÚerrors©rú@/tmp/pip-build-04bmskau/requests/requests/packages/idna/codec.pyr s  z Codec.encodecCsA|dkr!tdj|ƒƒ‚|s+dSt|ƒt|ƒfS)Nr z Unsupported error handling "{0}"r r)r r)rr rr )r rrrrrrs  z Codec.decodeN)Ú__name__Ú __module__Ú __qualname__rrrrrrrs  rc@seZdZdd„ZdS)ÚIncrementalEncoderc Csö|dkr!tdj|ƒƒ‚|s+dStj|ƒ}d}|ry|ds`d}|d =n|sy|d =|ryd}g}d}xA|D]9}|jt|ƒƒ|rµ|d7}|t|ƒ7}qŒWdj|ƒ|}|t|ƒ7}||fS) Nr z Unsupported error handling "{0}"r rrÚ.)r réÿÿÿÿrr)rr Ú_unicode_dots_reÚsplitÚappendrr Újoin) r rrÚfinalÚlabelsÚ trailing_dotÚresultÚsizeÚlabelrrrÚ_buffer_encodes0     z!IncrementalEncoder._buffer_encodeN)rrrr"rrrrrs rc@seZdZdd„ZdS)ÚIncrementalDecoderc Cs0|dkr!tdj|ƒƒ‚|s+dSt|tƒrLtj|ƒ}n(t|ƒ}t|dƒ|jdƒ}d}|r³|d sšd}|d =n|s³|d =|r³d}g}d}xA|D]9}|jt|ƒƒ|rï|d7}|t |ƒ7}qÆWdj |ƒ|}|t |ƒ7}||fS) Nr z Unsupported error handling "{0}"r rÚasciirr)r rrrr) rr Ú isinstanceÚunicoderrÚstrrrr r) r rrrrrrr r!rrrÚ_buffer_decode?s8       z!IncrementalDecoder._buffer_decodeN)rrrr(rrrrr#>s r#c@seZdZdS)Ú StreamWriterN)rrrrrrrr)gs r)c@seZdZdS)Ú StreamReaderN)rrrrrrrr*js r*cCs@tjdddtƒjdtƒjdtdtdtdtƒS) NÚnameÚidnarrÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreader) ÚcodecsÚ CodecInforrrrr#r)r*rrrrÚ getregentryms   r3)Úcorerrrrrr1ÚreÚcompilerrÚBufferedIncrementalEncoderrÚBufferedIncrementalDecoderr#r)r*r3rrrrÚs(  !)