Current File : //opt/alt/python35/lib64/python3.5/encodings/__pycache__/uu_codec.cpython-35.pyc
�q�\�
�@s�dZddlZddlZddlmZddddd�Zdd d
�ZGdd�dej�ZGd
d�dej�ZGdd�dej �Z Gdd�deej
�Z
Gdd�deej�Zdd�ZdS)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)Nrzbegin %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 CszCodec.encodecCs
t||�S)N)r#)r%r
rrrr�decodeFszCodec.decodeN)�__name__�
__module__�__qualname__r r&rrrrr$Bsr$c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)r%r
�finalrrrr JszIncrementalEncoder.encodeN)r'r(r)r rrrrr*Isr*c@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dS)Nr)r#r)r%r
r+rrrr&NszIncrementalDecoder.decodeN)r'r(r)r&rrrrr,Msr,c@seZdZeZdS)�StreamWriterN)r'r(r)�bytes�charbuffertyperrrrr-Qsr-c@seZdZeZdS)�StreamReaderN)r'r(r)r.r/rrrrr0Tsr0cCs: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!