B ˆ f# ã@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 ƒ}x|r~|t |¡ƒ|d ƒ}qbW|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ú7/opt/alt/python37/lib64/python3.7/encodings/uu_codec.pyÚ uu_encodes    rc Csð|dks t‚t|ƒ}tƒ}|j}|j}x(|ƒ}|s:tdƒ‚|dd…dkr(Pq(Wx‚|ƒ}|rd|dkrfPyt |¡}WnRtjk rÆ}z2|ddd@d dd } t |d| …¡}Wdd}~XYnX||ƒqRW|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%s0  $ r(c@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS)N)r)ÚselfrrrrrrGsz Codec.encodecCs t||ƒS)N)r()r*rrrrrÚ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-r.rrrrrr/Msr/c@seZdZddd„ZdS)ÚIncrementalDecoderFcCst||jƒdS)Nr)r(r)r*rr0rrrr+RszIncrementalDecoder.decodeN)F)r,r-r.r+rrrrr1Qsr1c@seZdZeZdS)Ú StreamWriterN)r,r-r.ÚbytesÚcharbuffertyperrrrr2Usr2c@seZdZeZdS)Ú StreamReaderN)r,r-r.r3r4rrrrr5Xsr5c Cstjdttttttdd�S)NÚuuF)Únamerr+ÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInforr(r/r1r5r2rrrrÚ getregentry]sr?)rrr)r) Ú__doc__r=rÚiorrr(r)r/r1r2r5r?rrrrÚs   !