3 \¡ ã@sždZddlZddlZddlmZddd„Zdd d „ZGd d „d ejƒZGd d„dejƒZGdd„dej ƒZ Gdd„deej ƒZ Gdd„deej ƒZ dd„Z dS)aPython 'uu_codec' Codec - UU content transfer encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lance Ellinghouse and modified by Jack Jansen and Fredrik Lundh. éN)ÚBytesIOÚstrictúé¶c Cstt|ƒ}tƒ}|j}|j}|d|d@|fjdƒƒ|dƒ}x|rZ|tj|ƒƒ|dƒ}q>W|dƒ|jƒt|ƒfS)Nz begin %o %s iÿÚasciié-s end )rÚreadÚwriteÚencodeÚbinasciiZb2a_uuÚgetvalueÚlen) ÚinputÚerrorsÚfilenameÚmodeÚinfileÚoutfilerr Úchunk©rú*/usr/lib64/python3.6/encodings/uu_codec.pyÚ uu_encodes rc Csæt|ƒ}tƒ}|j}|j}x(|ƒ}|s.tdƒ‚|dd…dkrPqWx„|ƒ}| sZ|dkr\Pytj|ƒ}WnRtjk r¼}z4|ddd@ddd } tj|d| …ƒ}WYdd}~XnX||ƒqFW|sÖtd ƒ‚|jƒt|ƒfS) Nz"Missing "begin" line in input dataésbeginsend ré é?éézTruncated input data) rÚreadliner Ú ValueErrorr Za2b_uuÚErrorr r ) rrrrrr ÚsÚdataÚvÚnbytesrrrÚ uu_decode!s.$ r$c@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS)N)r)Úselfrrrrrr Csz Codec.encodecCs t||ƒS)N)r$)r&rrrrrÚdecodeFsz Codec.decodeN)r)r)Ú__name__Ú __module__Ú __qualname__r r'rrrrr%Bs r%c@seZdZddd„ZdS)ÚIncrementalEncoderFcCst||jƒdS)Nr)rr)r&rÚfinalrrrr JszIncrementalEncoder.encodeN)F)r(r)r*r rrrrr+Isr+c@seZdZddd„ZdS)ÚIncrementalDecoderFcCst||jƒdS)Nr)r$r)r&rr,rrrr'NszIncrementalDecoder.decodeN)F)r(r)r*r'rrrrr-Msr-c@seZdZeZdS)Ú StreamWriterN)r(r)r*ÚbytesÚcharbuffertyperrrrr.Qsr.c@seZdZeZdS)Ú StreamReaderN)r(r)r*r/r0rrrrr1Tsr1c Cstjdttttttdd�S)NÚuuF)Únamer r'ÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInforr$r+r-r1r.rrrrÚ getregentryYsr;)rrr)r) Ú__doc__r9r Úiorrr$r%r+r-r.r1r;rrrrÚs   !