U e5d# ã@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}| dd¡}| dd¡}|d|d@|f d¡ƒ|d ƒ}|r||t |¡ƒ|d ƒ}q`|d ƒ| ¡t |ƒfS) NrÚ z\nú z\rz begin %o %s iÿÚasciié-s end ) ÚAssertionErrorrÚreadÚwriteÚreplaceÚencodeÚbinasciiZb2a_uuÚgetvalueÚlen) ÚinputÚerrorsÚfilenameÚmodeÚinfileÚoutfiler r Úchunk©rú*/usr/lib64/python3.8/encodings/uu_codec.pyÚ uu_encodes    rc Csè|dks t‚t|ƒ}tƒ}|j}|j}|ƒ}|s8tdƒ‚|dd…dkr&qLq&|ƒ}|rÌ|dkr`qÌzt |¡}WnRtjk rÀ}z2|ddd@d dd } t |d| …¡}W5d}~XYnX||ƒqL|sØtd ƒ‚| ¡t |ƒfS) Nrz"Missing "begin" line in input dataésbeginsend ré é?éézTruncated input data) r rÚreadliner Ú ValueErrorrZa2b_uuÚErrorrr) rrrrr!r ÚsÚdataÚvÚnbytesrrrÚ uu_decode%s,  $ r(c@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS©N)r©ÚselfrrrrrrGsz Codec.encodecCs t||ƒSr*)r(r+rrrÚdecodeJsz Codec.decodeN)r)r)Ú__name__Ú __module__Ú __qualname__rr-rrrrr)Fs r)c@seZdZddd„ZdS)ÚIncrementalEncoderFcCst||jƒdS©Nr)rr©r,rÚfinalrrrrNszIncrementalEncoder.encodeN)F)r.r/r0rrrrrr1Msr1c@seZdZddd„ZdS)ÚIncrementalDecoderFcCst||jƒdSr2)r(rr3rrrr-RszIncrementalDecoder.decodeN)F)r.r/r0r-rrrrr5Qsr5c@seZdZeZdS)Ú StreamWriterN©r.r/r0ÚbytesÚcharbuffertyperrrrr6Usr6c@seZdZeZdS)Ú StreamReaderNr7rrrrr:Xsr:c Cstjdttttttdd�S)NÚuuF)Únamerr-ÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInforr(r1r5r:r6rrrrÚ getregentry]sørD)rrr)r) Ú__doc__rBrÚiorrr(r)r1r5r6r:rDrrrrÚs    !