ok

Mini Shell

Direktori : /opt/alt/python38/lib64/python3.8/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/__pycache__/uu.cpython-38.opt-1.pyc

U

.��c:�@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/python38/lib64/python3.8/uu.pyr'sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dk�r0|�tj||d��|�d
�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r*sF








c

Csg}|dkrtjj}nt|t�r4t|d�}|�|��z�|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dkr�|d�d��d
�}tj�|�r�t	d|��|dkr�t
|d	d
�}|dk�rtjj}n0t|t��r8t|d�}t�||�|}|�|�|��}	|	�r�|	�d�dk�r�zt�|	�}
Wnjtj	k
�r�}zH|	ddd@ddd}t�|	d|��}
|�s�tj�d|�W5d}~XYnX|�|
�|��}	�q@|	�s�t	d��W5|D]}|���q�XdS)zDecode uuencoded filerr
z'No valid begin line found in input filesbegin� ��r��Ns 	
rz"Cannot overwrite existing file: %srsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�existsr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	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 argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrKrrr�print�argvr)rL�parserZoptions�args�input�outputrrr	�test�s6




rV�__main__)NN)NNF)�__doc__r&rr�__all__�	ExceptionrrrrVrrrrr	�<module>s
:
C&

Zerion Mini Shell 1.0