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 Cs€|dks t‚t|ƒ}tƒ}|j}|j}|d|d@|fjdƒƒ|dƒ}x|rf|tj|ƒƒ|dƒ}qJW|dƒ|jƒt|ƒfS)Nrz begin %o %s iÿÚasciié-s end ) ÚAssertionErrorrÚreadÚwriteÚencodeÚbinasciiZb2a_uuÚgetvalueÚlen) ÚinputÚerrorsÚfilenameÚmodeÚinfileÚoutfiler r Úchunk©rú*/usr/lib64/python3.6/encodings/uu_codec.pyÚ uu_encodes  rc Csò|dks t‚t|ƒ}tƒ}|j}|j}x(|ƒ}|s:tdƒ‚|dd…dkr(Pq(Wx„|ƒ}| sf|dkrhPytj|ƒ}WnRtjk rÈ}z4|ddd@d dd } tj|d| …ƒ}WYdd}~XnX||ƒqRW|sâtd ƒ‚|jƒt |ƒfS) Nrz"Missing "begin" line in input dataésbeginsend ré é?éézTruncated input data) rrÚreadliner Ú ValueErrorr Za2b_uuÚErrorr r) rrrrrr ÚsÚdataÚvÚnbytesrrrÚ uu_decode!s0 $ 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+r0r1rrrrr2Tsr2c Cstjdttttttdd�S)NÚuuF)Únamer r(ÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInforr%r,r.r2r/rrrrÚ getregentryYsr<)rrr)r) Ú__doc__r:r Úiorrr%r&r,r.r/r2r<rrrrÚs   !