Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function : NONE
3
\
@ s d Z ddlZddlZddlmZ dddZdd d
ZG dd dejZG d
d dejZG dd dej Z G dd deej
Z
G dd deejZdd ZdS )a Python '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)BytesIOstrict c C st t | }t }|j}|j}|d|d@ |f jd |d}x|rZ|tj| |d}q>W |d |j t| fS )Nzbegin %o %s
i ascii- s
end
)r readwriteencodebinasciiZb2a_uugetvaluelen) inputerrorsfilenamemodeinfileoutfiler r chunk r /usr/lib64/python3.6/uu_codec.py uu_encode s r c
C s t | }t }|j}|j}x(| }|s.td|d d dkrP qW x| }| sZ|dkr\P ytj|}W nR tjk
r } z4|d d d@ d d d } tj|d | }W Y d d }~X nX || qFW |std
|j t| fS )Nz"Missing "begin" line in input data s begins end
r ? zTruncated input data) r readliner
ValueErrorr Za2b_uuErrorr r
)
r r r r r r sdatavnbytesr r r uu_decode! s. $r$ c @ s e Zd ZdddZdddZdS ) Codecr c C s
t ||S )N)r )selfr r r r r r
C s zCodec.encodec C s
t ||S )N)r$ )r&