AlkantarClanX12

Your IP : 3.145.93.227


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/uu.cpython-311.pyc

�

xk�f����dZddlZddlZddlZddlZejed���gd�ZGd�de��Z	ddd	�d
�Z
dd�Zd�Zed
kre��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)��
)�remove)�Error�encode�decodec��eZdZdS)rN)�__name__�
__module__�__qualname__���)/opt/alt/python311/lib64/python3.11/uu.pyrr)s�������DrrF��backtickc�r�g}	|dkrtjj}n�t|t��rs|�t
j�|��}|�+	tj|��j	}n#t$rYnwxYwt|d��}|�|��|dkrtj
j}n:t|t��r%t|d��}|�|��|�d}|�d}|�dd��}|�dd	��}|�d
|dz|fz�d����|�d
��}t%|��dkrQ|�t'j||�����|�d
��}t%|��dk�Q|r|�d��n|�d��|D]}|����dS#|D]}|����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,sL��
�L�1��c�>�>��i�&�G�G�
���
%�
%�		)��|��w�'�'��0�0���|���7�7�+�+�3�D�D��%�����D������7�D�)�)�G�����(�(�(��s�?�?��z�(�H�H�
��#�
&�
&�	*��H�d�+�+�H�����)�)�)��<��D��<��D�
�|�|�D��'�'���|�|�D��'�'��
	����D�5�L�4�*@�@�H�H��Q�Q�R�R�R��|�|�B�����$�i�i�!�m�m��N�N�8�?�4�(�C�C�C�D�D�D��<�<��#�#�D��$�i�i�!�m�m��	(��N�N�;�'�'�'�'��N�N�;�'�'�'��	�	�A�
�G�G�I�I�I�I�	�	���	�	�A�
�G�G�I�I�I�I�	���s1�AH�A/�.H�/
A<�9H�;A<�<FH�H6c�0�g}|dkrtjj}n:t|t��r%t|d��}|�|��		|���}|std���|�	d��s�<|�
dd��}t|��dkr4|d	dkr(	t|d
d��n#t$rYnwxYw��|��|d�d
���d��}t j�|��rtd|�����|�	t j��sMdt j��|vs<t jrC|�	t j��sdt j��|vrtd|�d����|�t|d
d��}|dkrtjj}nQt|t��r<t|d��}t!j||��|}|�|��|���}|r�|�d
��dkr�	t1j|��}	ns#t0j$ra}
|d	dz
dzdzdzdz}t1j|d|���}	|s"tj�d|
z��Yd}
~
nd}
~
wwxYw|�|	��|���}|r|�d
��dk��|std���	|D]}|����dS#|D]}|����wxYw)zDecode uuencoded filerrTz'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��
G��E�F�F�F��>�>�(�+�+�
���	�	�$��*�*�I��9�~�~��"�"�y��|�x�'?�'?���	�!��a�(�(�(���!�����D�����	��� ��|�*�*�<�8�8�?�?��H�H�H��w�~�~�h�'�'�
K��I�x�I�I�J�J�J��#�#�B�F�+�+�
[��R�V�
�
��)�)��I�*��(�(���3�3�*�&�"�)�%�%��1�1��Y�H�Y�Y�Y�Z�Z�Z��<��y��|�Q�'�'�D��s�?�?��z�(�H�H�
��#�
&�
&�	*��h��%�%�B��H�X�t�$�$�$��H�����)�)�)�
�������
	#�A�G�G�L�)�)�V�3�3�
:���q�)�)�����>�
:�
:�
:��a�D��G�r�>�Q�.��2�q�8����q��&��z�2�2���:��J�$�$�_�q�%8�9�9�9����������
:����
�N�N�4� � � �� � �"�"�A��
	#�A�G�G�L�)�)�V�3�3��	0��.�/�/�/�	0��	�	�A�
�G�G�I�I�I�I�	�	���	�	�A�
�G�G�I�I�I�I�	���s^�A1M:�C�M:�
C,�)M:�+C,�,FM:�J�M:�L�%AL�<M:�L�AM:�:Nc���ddl}|�d���}|�ddddd	d
���|�dd
ddd	d
���|���\}}t	|��dkr)|�d��t
jd��tjj	}tj
j	}t	|��dkr|d}t	|��dkr|d}|jrs|jrZt|t��rt|d��}n4t!tjdd��t
jd��t||��dS|jrZt|t��rt|d��}n4t!tjdd��t
jd��t%||��dS)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�s����O�O�O�
�
"�
"�)R�
"�
S�
S�F�
���d�J�X�<Y�ch�q}��~�~�~�
���d�H�6�8l�v{�EQ��R�R�R��'�'�)�)�O�W�d�
�4�y�y�1�}�}����4�5�5�5�������
�I��E�
�Z�
�F�
�4�y�y�1�}�}��Q���
�4�y�y�1�}�}��a����~���<�	��&�#�&�&�
��f�d�+�+����c�h�q�k�#=�>�>�>��������u�f�������<�	��%��%�%�
��U�D�)�)����c�h�q�k�#>�?�?�?��������u�f�����r�__main__)NN)NNF)
�__doc__r,rr�warnings�_deprecatedr
�__all__�	Exceptionrrrrhr
rr�<module>ros���4������	�	�	�	�
�
�
�
��������X�g�.�.�.�.�
'�
'�
'��	�	�	�	�	�I�	�	�	�7��7�7�7�7�7�tH�H�H�H�T$�$�$�L�z����D�F�F�F�F�F��r