Viewing File: /opt/alt/python35/lib64/python3.5/encodings/__pycache__/uu_codec.cpython-35.pyc



¯ÕYf¡
ã@sådZddlZddlZddlmZddddd„Zdd	d
„ZGdd„dejƒZGd
d„dejƒZGdd„dej	ƒZ	Gdd„deej
ƒZ
Gdd„deejƒZdd„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Ústrictz<data>i¶c	Cs²|dkst‚t|ƒ}tƒ}|j}|j}|d|d@|fjdƒƒ|dƒ}x)|r‘|tj|ƒƒ|dƒ}qiW|dƒ|jƒt|ƒfS)Nrzbegin %o %s
iÿÚasciié-s 
end
)	ÚAssertionErrorrÚreadÚwriteÚencodeÚbinasciiZb2a_uuÚgetvalueÚlen)	ÚinputÚerrorsÚfilenameÚmodeÚinfileÚoutfilerrÚchunk©rú7/opt/alt/python35/lib64/python3.5/encodings/uu_codec.pyÚ	uu_encodes			!	
rc
Cs=|dkst‚t|ƒ}tƒ}|j}|j}x6|ƒ}|sWtdƒ‚|dd…dkr<Pq<Wx |ƒ}|s‘|dkr’Pytj|ƒ}Wn_tjk
r}z<|ddd@d	dd
}	tj|d|	…ƒ}WYdd}~XnX||ƒquW|s'tdƒ‚|jƒt	|ƒfS)Nrz"Missing "begin" line in input dataésbeginsend
ré é?éézTruncated input data)
rrÚreadlinerÚ
ValueErrorr
Za2b_uuÚErrorrr)
r
rrrrrÚsÚdataÚvÚnbytesrrrÚ	uu_decode!s0					,r#c@s.eZdZddd„Zddd„ZdS)ÚCodecrcCs
t||ƒS)N)r)Úselfr
rrrrr	CszCodec.encodecCs
t||ƒS)N)r#)r%r
rrrrÚdecodeFszCodec.decodeN)Ú__name__Ú
__module__Ú__qualname__r	r&rrrrr$Bsr$c@seZdZddd„ZdS)ÚIncrementalEncoderFcCst||jƒdS)Nr)rr)r%r
Úfinalrrrr	JszIncrementalEncoder.encodeN)r'r(r)r	rrrrr*Isr*c@seZdZddd„ZdS)ÚIncrementalDecoderFcCst||jƒdS)Nr)r#r)r%r
r+rrrr&NszIncrementalDecoder.decodeN)r'r(r)r&rrrrr,Msr,c@seZdZeZdS)ÚStreamWriterN)r'r(r)ÚbytesÚcharbuffertyperrrrr-Qsr-c@seZdZeZdS)ÚStreamReaderN)r'r(r)r.r/rrrrr0Tsr0cCs:tjdddtdtdtdtdtdtd	d
ƒS)NÚnameÚuur	r&ÚincrementalencoderÚincrementaldecoderÚstreamreaderÚstreamwriterÚ_is_text_encodingF)ÚcodecsÚ	CodecInforr#r*r,r0r-rrrrÚgetregentryYs	r:)
Ú__doc__r8r
Úiorrr#r$r*r,r-r0r:rrrrÚ<module>s!
Back to Directory File Manager