AlkantarClanX12

Your IP : 18.219.231.197


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/uu.cpython-310.pyc

o

`�fm�@sldZddlZddlZddlZgd�ZGdd�de�Zddd�dd	�Zdd
d�Zdd
�Z	e
dkr4e	�dSdS)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/python310/lib64/python3.10/uu.pyr&srF��backtickc	Csxg}z�|dkrtjj}n/t|t�r;|durtj�|�}|dur1zt�|�j	}Wn	t
y0Ynwt|d�}|�|�|dkrDtj
j}nt|t�rSt|d�}|�|�|durYd}|dur_d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dkr�|�tj||d��|�d
�}t|�dks�|r�|�d�n|�d�W|D]}|��q�dS|D]}|��q�w)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
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)sR

�







�
�
�
�rc

Cs~g}|dkrtjj}nt|t�rt|d�}|�|��z	|��}|s'td��|�	d�s-q|�
dd�}t|�dkrR|d	dkrRz	t|d
d�Wn
t
yQYnwq|dur�|d�d
��d�}tj�|�rntd|����|�	tj�s�dtj��|vs�tjr�|�	tj�s�dtj��|vr�td|�d���|dur�t|d
d�}|dkr�tjj}nt|t�r�t|d�}t�||�|}|�|�|��}|�r |�d
�dk�r zt�|�}	Wn6tj�y}
z(|d	dd@ddd}t�|d|��}	|�stj�d|
�WYd}
~
nd}
~
ww|�|	�|��}|�r |�d
�dks�|�s'td��W|D]}|���q*dS|D]}|���q6w)zDecode uuencoded filerr
Tz'No valid begin line found in input filesbegin� ��r��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr�readliner�
startswith�splitr$�int�
ValueError�rstriprrr�exists�sep�altsepr �chmod�stripr%Za2b_uu�stderrr"r&)
r'r(r*�quietr+ZhdrZ	hdrfields�fp�sr,�v�nbytesr-rrr	rcs�




��
�
�



��
����rcCs2ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkr6|�d�t�d�tjj	}tj
j	}t|�dkrH|d}t|�dkrR|d}|jrw|jrpt
|t�rct|d�}n
ttjdd�t�d�t||�dS|jr�t
|t�r�t|d�}n
ttjdd�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 rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6





rX�__main__)NN)NNF)�__doc__r%rr�__all__�	ExceptionrrrrXrrrrr	�<module>s
:J&
�