Your IP : 3.15.192.89


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/uu.cpython-312.opt-1.pyc

�

�S�f����dZddlZddlZddlZddlZej
ed��gd�ZGd�de�Z	ddd	�d
�Z
dd�Zd�Zed
k(re�yy)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)��
)�remove)�Error�encode�decodec��eZdZy)rN)�__name__�
__module__�__qualname__���)/opt/alt/python312/lib64/python3.12/uu.pyrr)s��rrF��backtickc��g}	|dk(rtjj}npt|t�r`|�t
jj|�}|� 	tj|�j}t|d�}|j|�|dk(rtjj}n-t|t�rt|d�}|j|�|�d}|�d}|jdd�}|jdd	�}|jd
|dz|fzj!d��|j#d
�}t%|�dkDrF|jt'j(||���|j#d
�}t%|�dkDr�F|r|jd�n|jd�|D]}|j+��y#t$rY��lwxYw#|D]}|j+��wxYw)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rrs`
end
s 
end
)�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binascii�b2a_uu�close)�in_file�out_file�name�moder�opened_files�data�fs        rrr,s���
�L�1��c�>��i�i�&�&�G�
���
%��|��w�w�'�'��0���|���7�7�7�+�3�3�D��7�D�)�G�����(��s�?��z�z�(�(�H�
��#�
&��H�d�+�H�����)��<��D��<��D�
�|�|�D��'���|�|�D��'��
	����D�5�L�4�*@�@�H�H��Q�R��|�|�B����$�i�!�m��N�N�8�?�?�4�(�C�D��<�<��#�D��$�i�!�m���N�N�;�'��N�N�;�'��A�
�G�G�I���O&�����N�A�
�G�G�I��s7�AG'�G�7D"G'�%G'�	G$� G'�#G$�$G'�'Hc��g}|dk(rtjj}n-t|t�rt|d�}|j
|�		|j�}|std��|jd�s�0|jdd�}t|�dk(r|ddk(r	t|d	d
�n�i|��|djd�jd
�}t j"j%|�rtd|����|jt j&�sYdt j&��|vsDt j(rC|jt j(�sdt j(��|vrtd|�d���|�t|d	d
�}|dk(rtj*j}nEt|t�r5t|d�}t!j,||�|}|j
|�|j�}|rb|j/d�dk7rN	t1j2|�}	|j7|	�|j�}|r|j/d�dk7r�N|std��	|D]}|j9��y#t$rY���wxYw#t0j$rZ}
|ddz
dzdzdzdz}t1j2|d|�}	|s"tj4j7d|
z�Yd}
~
��d}
~
wwxYw#|D]}|j9��wxYw)zDecode uuencoded filerrz'No valid begin line found in input filesbegin� �rr��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrr%r&�readliner�
startswith�splitr+�int�
ValueError�rstriprrr �exists�sep�altsepr'�chmod�stripr,�a2b_uu�stderrr)r.)
r/r0r2�quietr3�hdr�	hdrfields�fp�sr4�v�nbytesr5s
             rrrfs���
�L��#�~��)�)�"�"��	�G�S�	!��w��%�����G�$�<���"�"�$�C���E�F�F��>�>�(�+���	�	�$��*�I��9�~��"�y��|�x�'?���	�!��a�(����� ��|�*�*�<�8�?�?��H�H��w�w�~�~�h�'��>�x�j�I�J�J��#�#�B�F�F�+��R�V�V�H�
��)��I�I��(�(����3��"�)�)��%��1��3�H�:�=X�Y�Z�Z��<��y��|�Q�'�D��s�?��z�z�(�(�H�
��#�
&��h��%�B��H�H�X�t�$��H�����)�
������A�G�G�L�)�V�3�
:����q�)��
�N�N�4� �� � �"�A��A�G�G�L�)�V�3���.�/�/���A�
�G�G�I���Y"�����B�>�>�
:��a�D��G�r�>�Q�.��2�q�8�����q��&�z�2����J�J�$�$�_�q�%8�9���
:���A�
�G�G�I��sc�AL$�*J$�9E7L$�1J4�7L$�>
L$�$	J1�-L$�0J1�1L$�4L!�AL�L$�L!�!L$�$L=c��ddl}|jd��}|jddddd	d
��|jdd
ddd	d
��|j�\}}t	|�dkDr&|jd�t
jd�tjj}tjj}t	|�dkDr|d}t	|�dkDr|d}|jrh|jrOt|t�r
t|d�}n2t!tj"dd�t
jd�t||�y|jrOt|t�r
t|d�}n2t!tj"dd�t
jd�t%||�y)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])�usagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r8zincorrect number of argumentsr9rz: cannot do -t to stdoutrz: cannot do -t from stdin)�optparse�OptionParser�
add_option�
parse_argsr+�errorr�exitrrr'rrZrrr%�print�argvr)r[�parser�options�args�input�outputs      r�testrh�sl���
�
"�
"�)R�
"�
S�F�
���d�J�X�<Y�ch�q}��~�
���d�H�6�8l�v{�EQ��R��'�'�)�O�W�d�
�4�y�1�}����4�5������
�I�I���E�
�Z�Z�
�
�F�
�4�y�1�}��Q���
�4�y�1�}��a����~�~��<�<��&�#�&��f�d�+���c�h�h�q�k�#=�>�������u�f���<�<��%��%��U�D�)���c�h�h�q�k�#>�?�������u�f�r�__main__)NN)NNF)
�__doc__r,rr�warnings�_deprecatedr
�__all__�	Exceptionrrrrhr
rr�<module>rosi��4��	�
������X�g�.�
'��	�I�	�7��7�tH�T$�L�z���F�r

?>