%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/uu.cpython-37.pyc

B

��a:�@sjdZddlZddlZddlZdddgZGdd�de�Zddd�d	d�Zdd
d�Zdd�Z	e
d
krfe	�dS)z�Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�'/opt/alt/python37/lib64/python3.7/uu.pyr'sF)�backtickc	Csrg}�zL|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfyt�|�j	}Wnt
k
rdYnXt|d�}|�|�|dkr�tj
j}nt|t�r�t|d�}|�|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}x2t|�dk�r2|�tj||d��|�d
�}�qW|�rF|�d�n
|�d�Wdx|D]}|���qZWXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-r)r
s`
end
s 
end
)�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu�close)�in_file�out_file�name�moder
�opened_files�data�frrr	r*sF









c

Csg}|dkrtjj}nt|t�r4t|d�}|�|��z�xr|��}|sNtd��|�	d�sZq:|�
dd�}t|�dkr:|ddkr:yt|d	d
�PWq:t
k
r�Yq:Xq:W|dkr�|d�d��d
�}tj�|�r�td|��|dkr�t|d	d
�}|dk�r
tjj}n0t|t��r:t|d�}t�||�|}|�|�|��}x�|�r�|�d�dk�r�yt�|�}	Wnjtjk
�r�}
zH|ddd@ddd}t�|d|��}	|�s�tj�d|
�Wdd}
~
XYnX|�|	�|��}�qDW|�s�td��Wdx|D]}|���qWXdS)zDecode uuencoded filerrz'No valid begin line found in input filesbegin� ��r��Ns 	
rz"Cannot overwrite existing file: %sr
send� �?��zWarning: %s
zTruncated input file)rrrrrrr�readliner�
startswith�splitr#�int�
ValueError�rstriprrr�existsr�chmod�stripr$Za2b_uu�stderrr!r%)
r&r'r)�quietr*ZhdrZ	hdrfields�fp�sr+�v�nbytesr,rrr	rds`









"

cCs4ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r.zincorrect number of argumentsr0r
z: cannot do -t to stdoutrz: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr#�errorr�exitrrrrrJrrr�print�argvr)rK�parserZoptions�args�input�outputrrr	�test�s6




rU�__main__)NN)NNF)�__doc__r$rr�__all__�	ExceptionrrrrUrrrrr	�<module>s
:
C&

Zerion Mini Shell 1.0