Rh# dZddlZddlZddlmZddZddZGddejZGdd ejZGd d ejZ Gd d eejZ GddeejZ dZ y)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)BytesIOc|dk(sJt|}t}|j}|j}|jdd}|jdd}|d|dz|fzj d|d }|r&|t j ||d }|r&|d |jt|fS) Nstrict z\n z\rz begin %o %s iascii-s end ) rreadwritereplaceencodebinasciib2a_uugetvaluelen) inputerrorsfilenamemodeinfileoutfiler r chunks )/usr/lib/python3.12/encodings/uu_codec.py uu_encoders X   U^FiG ;;D MMEU+HU+H ?dUlH5 5 = =g FG HE  hooe$%R  +    E ++c|dk(sJt|}t}|j}|j} |}|s td|dddk(rn |}|r|dk(rn t j |}||.|s td |jt|fS#tj $r6}|ddz dzd zdzd z} t j |d| }Yd}~ud}~wwxYw) Nrz"Missing "begin" line in input datasbeginsend r ?zTruncated input data) rreadliner ValueErrorra2b_uuErrorrr) rrrrr"r sdatavnbytess r uu_decoder*%s X   U^FiGH MME JAB B Ra5H     JAM  /??1%D d   /00    E ++~~ /!R2~*Q.14F??1Wf:.D /s%B++C4>,C//C4ceZdZddZddZy)Codecct||SN)rselfrrs rr z Codec.encodeG''rct||Sr.)r*r/s rdecodez Codec.decodeJr1rNr)__name__ __module__ __qualname__r r3rrr,r,Fs ((rr,ceZdZddZy)IncrementalEncoderc4t||jdSNr)rrr0rfinals rr zIncrementalEncoder.encodeN ,Q//rNF)r5r6r7r r8rrr:r:M0rr:ceZdZddZy)IncrementalDecoderc4t||jdSr<)r*rr=s rr3zIncrementalDecoder.decodeRr?rNr@)r5r6r7r3r8rrrCrCQrArrCceZdZeZy) StreamWriterNr5r6r7bytescharbuffertyper8rrrFrFUNrrFceZdZeZy) StreamReaderNrGr8rrrLrLXrJrrLc ltjdtttt t tdS)NuuF)namer r3incrementalencoderincrementaldecoder streamreader streamwriter_is_text_encoding)codecs CodecInforr*r:rCrLrFr8rr getregentryrW]s-    --!!  r)rzir4) __doc__rUriorrr*r,r:rCrFrLrWr8rrrZs,*,B(FLL(022002205&--5&-- r