ó {fc@sÌdZddlZddlZdddd„Zdd„Zdejfd „ƒYZd ejfd „ƒYZd ejfd „ƒYZdeejfd„ƒYZdeej fd„ƒYZ d„Z dS(sz Python 'uu_codec' Codec - UU content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. 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. iÿÿÿÿNtstrictsi¶c CsÞddlm}ddlm}|t|ƒƒ}|ƒ}|j}|j} |jddƒ}|jddƒ}| d|d @|fƒ|d ƒ} x&| r½| || ƒƒ|d ƒ} q˜W| d ƒ|jƒt |ƒfS( s Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling which is the only currently supported error handling for this codec. iÿÿÿÿ(tStringIO(tb2a_uus s\ns s\rs begin %o %s iÿi-s end ( t cStringIORtbinasciiRtstrtreadtwritetreplacetgetvaluetlen( tinputterrorstfilenametmodeRRtinfiletoutfileRRtchunk((s*/usr/lib64/python2.7/encodings/uu_codec.pyt uu_encodes       c Cs9ddlm}ddlm}|t|ƒƒ}|ƒ}|j}|j}x3|ƒ}|sktd‚n|d dkrPPqPqPWx‹|ƒ}| s¢|dkr¦Pny||ƒ} WnJtjk r} t |dƒd d @d dd } ||| ƒ} nX|| ƒq†W|s#td ‚n|j ƒt |ƒfS(s# Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error handling to apply. It defaults to 'strict' handling which is the only currently supported error handling for this codec. Note: filename and file mode information in the input data is ignored. iÿÿÿÿ(R(ta2b_uus"Missing "begin" line in input dataitbeginsend ii i?iisTruncated input data( RRRRRtreadlineRt ValueErrortErrortordR R ( R R RRRRRRtstdatatvtnbytes((s*/usr/lib64/python2.7/encodings/uu_codec.pyt uu_decode0s4       $ tCodeccBs eZdd„Zdd„ZRS(RcCs t||ƒS(N(R(tselfR R ((s*/usr/lib64/python2.7/encodings/uu_codec.pytencodefscCs t||ƒS(N(R(RR R ((s*/usr/lib64/python2.7/encodings/uu_codec.pytdecodeis(t__name__t __module__R R!(((s*/usr/lib64/python2.7/encodings/uu_codec.pyRds tIncrementalEncodercBseZed„ZRS(cCst||jƒdS(Ni(RR (RR tfinal((s*/usr/lib64/python2.7/encodings/uu_codec.pyR ms(R"R#tFalseR (((s*/usr/lib64/python2.7/encodings/uu_codec.pyR$lstIncrementalDecodercBseZed„ZRS(cCst||jƒdS(Ni(RR (RR R%((s*/usr/lib64/python2.7/encodings/uu_codec.pyR!qs(R"R#R&R!(((s*/usr/lib64/python2.7/encodings/uu_codec.pyR'pst StreamWritercBseZRS((R"R#(((s*/usr/lib64/python2.7/encodings/uu_codec.pyR(tst StreamReadercBseZRS((R"R#(((s*/usr/lib64/python2.7/encodings/uu_codec.pyR)wscCs:tjdddtdtdtdtdtdtd tƒS( NtnametuuR R!tincrementalencodertincrementaldecodert streamreadert streamwritert_is_text_encoding( tcodecst CodecInfoRRR$R'R)R(R&(((s*/usr/lib64/python2.7/encodings/uu_codec.pyt getregentry|s ( t__doc__R1RRRRR$R'R(R)R3(((s*/usr/lib64/python2.7/encodings/uu_codec.pyt s! 4