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Œt|ƒ}tƒ}|j}|j}| dd¡}| dd¡}|d|d@|f d¡ƒ|dƒ}x|rr|t |¡ƒ|dƒ}qVW|d ƒ| ¡t|ƒfS) NÚ z\nú z\rz begin %o %s iÿÚasciié-s end ) rÚ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ät|ƒ}tƒ}|j}|j}x(|ƒ}|s.tdƒ‚|dd…dkrPqWx‚|ƒ}|rX|dkrZPyt |¡}WnRtjk rº}z2|ddd@ddd } t |d| …¡}Wdd}~XYnX||ƒqFW|sÔtd ƒ‚| ¡t|ƒfS) Nz"Missing "begin" line in input dataésbeginsend ré é?éézTruncated input data) 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)Úselfrrrrrr Gsz Codec.encodecCs t||ƒS)N)r')r)rrrrrÚdecodeJsz Codec.decodeN)r)r)Ú__name__Ú __module__Ú __qualname__r r*rrrrr(Fs r(c@seZdZddd„ZdS)ÚIncrementalEncoderFcCst||jƒdS)Nr)rr)r)rÚfinalrrrr NszIncrementalEncoder.encodeN)F)r+r,r-r rrrrr.Msr.c@seZdZddd„ZdS)ÚIncrementalDecoderFcCst||jƒdS)Nr)r'r)r)rr/rrrr*RszIncrementalDecoder.decodeN)F)r+r,r-r*rrrrr0Qsr0c@seZdZeZdS)Ú StreamWriterN)r+r,r-ÚbytesÚcharbuffertyperrrrr1Usr1c@seZdZeZdS)Ú StreamReaderN)r+r,r-r2r3rrrrr4Xsr4c Cstjdttttttdd�S)NÚuuF)Únamer r*ÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInforr'r.r0r4r1rrrrÚ getregentry]sr>)rrr)r) Ú__doc__r<rÚiorrr'r(r.r0r1r4r>rrrrÚs   !