Sindbad~EG File Manager

Current Path : /proc/thread-self/root/opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python312/lib64/python3.12/__pycache__/gzip.cpython-312.opt-2.pyc

�

��h:c���	ddlZddlZddlZddlZddlZddlZddlZddlZddlZgd�Z	d\Z
ZZZ
Zd\ZZdZdZdZdZd	ej*zZd
edddfd�Zd�ZGd
�d�ZGd�de�ZGd�dej8�ZGd�dej<�Zd�Z d�Z!Gd�dejD�Z#	d!de$de%fd�Z&efdd�d�Z'd�Z(d�Z)e*d k(re)�yy)"�N)�BadGzipFile�GzipFile�open�compress�
decompress)�����)rr	r��	ir
�rbc���	d|vrd|vr5td|����|�td��|�td��|�td��|jdd�}t|ttt
jf�rt|||�}n2t|d�st|d	�rtd|||�}ntd
��d|vr-tj|�}tj||||�S|S)N�t�bzInvalid mode: z0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)
�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
text_encoding�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newline�gz_mode�binary_files        �+/opt/alt/python312/lib64/python3.12/gzip.pyrr s����$�d�{��$�;��4�9�:�:����O�P�P����M�N�N����N�O�O��l�l�3��#�G��(�S�%����5�6��x��-�@��	��6�	"�g�h��&@��t�W�m�X�F���K�L�L�
�d�{��#�#�H�-������X�v�w�G�G���c�N�|jtjd|��y)Nz<L)r�struct�pack)�output�values  r*�write32ur1Ms���L�L����T�5�)�*r+c�0�eZdZ	dd�Zd�Zdd�Zd�Zd�Zy)�_PaddedFilec�N�||_t|�|_||_d|_y�Nr)�_buffer�len�_length�file�_read)�self�f�prepends   r*�__init__z_PaddedFile.__init__Ws"������7�|�����	���
r+c��|j�|jj|�S|j|z|jkr:|j}|xj|z
c_|j||jS|j}d|_|j|d|jj||jz
|z�zS�N)r:r9rr8r6)r;�sizers   r*rz_PaddedFile.read]s����:�:���9�9�>�>�$�'�'��:�:������,��:�:�D��J�J�$��J��<�<��T�Z�Z�0�0��:�:�D��D�J��<�<���&��9�9�>�>�$�t�|�|�"3�D�"8�9�:�
:r+c��|j�||_n|xjt|�zc_yt|j�|_d|_yr5)r:r6r7r8)r;r=s  r*r=z_PaddedFile.prependjs?���:�:��"�D�L��J�J�#�g�,�&�J���4�<�<�(�����
r+c�T�d|_d|_|jj|�Sr@)r:r6r9�seek)r;�offs  r*rDz_PaddedFile.seekss#����
�����y�y�~�~�c�"�"r+c��y�NT��r;s r*�seekablez_PaddedFile.seekablex���r+N)r+)�__name__�
__module__�__qualname__r>rr=rDrJrHr+r*r3r3Rs �� ��:��#�
r+r3c��eZdZy)rN)rLrMrNrHr+r*rr|s��@r+rc�&�eZdZ	d�Zd�Zd�Zd�Zy)�_WriteBufferStreamc�8�tj|�|_yr@)�weakref�ref�	gzip_file)r;rUs  r*r>z_WriteBufferStream.__init__�s�� ���Y�/��r+c�^�|j�}|�td��|j|�S)Nzlost gzip_file)rU�RuntimeError�
_write_raw)r;�datarUs   r*rz_WriteBufferStream.write�s1���N�N�$�	����/�0�0��#�#�D�)�)r+c��y)NFrHrIs r*rJz_WriteBufferStream.seekable�s��r+c��yrGrHrIs r*�writablez_WriteBufferStream.writable�rKr+N)rLrMrNr>rrJr\rHr+r*rQrQ�s��B�0�*��r+rQc���eZdZ	dZddeddfd�Zed��Zd�Zd�Z	�fd�Z
d�Zd�Zd	�Z
dd
�Zdd�Zd�Zed
��Zd�Zd�Zej*fd�Zd�Zd�Zd�Zd�Zd�Zej:fd�Zdd�Z�xZ S)rNc�<�	|r"d|vsd|vrtdj|���|r	d|vr|dz
}	|�!tj||xsd�x}|_|�&t|dd�}t
|ttf�sd}ntj|�}|}|�
t|dd�}|jd	�r8t|_
t|�}tj |�|_||_n�|jd
�r�|�ddl}|j)dt*d
�t,|_
|j/|�t1j2|t0j4t0j6t0j8d�|_||_t>|_ tjBtE|�|j@��|_ntdj|���||_#|jt,k(r|jI|�yy#|jK��xYw)Nr�UzInvalid mode: {!r}rr�namerr#�r)�w�a�xrz�GzipFile was opened for writing, but this will change in future Python releases.  Specify the mode argument for opening it for writing.r	)�buffer_size)&r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr#�_GzipReaderr�BufferedReaderr6r`�warnings�warn�
FutureWarning�WRITE�_init_write�zlib�compressobj�DEFLATED�	MAX_WBITS�
DEF_MEM_LEVELr�_write_mtime�_WRITE_BUFFER_SIZE�_buffer_size�BufferedWriterrQ�fileobj�_write_gzip_header�_close)	r;r"r#r$r}�mtime�origmode�rawros	         r*r>zGzipFile.__init__�s���	�B�S�D�[�C�4�K��1�8�8��>�?�?��C�t�O��C�K�D�2	���+3�=�=��4�<�4�+P�P��$�.���"�7�F�B�7��!�(�S�%�L�9�!�H��9�9�X�.���H��|��w���5�����s�#� ��	�!�'�*��!�0�0��5���$��	�����1��#�#��M�M�P�&�q�	*�
"��	�� � ��*� $� 0� 0��15���26�.�.��15�1C�1C�12�	!4��
�
%*��!�$6��!�!�0�0�1C�D�1I�=A�=N�=N� P���!�!5�!<�!<�T�!B�C�C�"�D�L��y�y�E�!��'�'�
�6�"��	�
�K�K�M��s�GH�Hc�D�	|jjjSr@)r6r��_last_mtimerIs r*r�zGzipFile.mtime�s��>��|�|���+�+�+r+c�r�t|j�}d|ddzdztt|��zdzS)Nz<gzip r���� �>)�reprr}�hex�id)r;�ss  r*�__repr__zGzipFile.__repr__s8���������!�A�b�'�!�C�'�#�b��h�-�7�#�=�=r+c�~�||_tjd�|_d|_g|_d|_d|_y�Nr+r)r`rt�crc32�crcrA�writebuf�bufsize�offset)r;r"s  r*rszGzipFile._init_writes4����	��:�:�c�?�����	���
������r+c�t��|j�|jj�t�|��Sr@)�_check_not_closedr6�flush�super�tell�r;�	__class__s �r*r�z
GzipFile.tells+������ ��������w�|�~�r+c�2�|jjd�|jjd�	tjj	|j
�}t
|t�s|jd�}|jd�r|dd}d}|rt}|jjt|�jd��|j}|�tj�}t|jt!|��|t"k(rd}n|t$k(rd	}nd
}|jj|�|jjd�|r|jj|d
z�yy#t$rd}Y��wxYw)N���zlatin-1s.gz���r+r�����)r}rr�path�basenamer`rr�encode�endswith�UnicodeEncodeError�FNAME�chrry�timer1�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r;r$�fname�flagsr��xfls      r*r~zGzipFile._write_gzip_headersJ�������;�'������7�#�		��G�G�$�$�T�Y�Y�/�E��e�U�+����Y�/���~�~�f�%��c�r�
������E������3�u�:�,�,�Y�7�8��!�!���=��I�I�K�E�����s�5�z�*��0�0��C�
�2�
2��C��C������3�������7�#���L�L���u�w��/���%"�	��E�	�s�A F�F�Fc���|j�|jtk7rddl}t	|j
d��|j�td��|jj|�S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)
r�r#rr�errno�OSError�EBADFr}rr6r)r;rYr�s   r*rzGzipFile.write1sZ����� ��9�9�����%�+�+�'M�N�N��<�<���@�A�A��|�|�!�!�$�'�'r+c��t|ttf�rt|�}nt	|�}|j
}|dkDr�|jj|jj|��|xj|z
c_	tj||j�|_|xj|z
c_
|Sr5)rr�	bytearrayr7�
memoryview�nbytesr}rrrArtr�r�r�)r;rY�lengths   r*rXzGzipFile._write_raw<s����d�U�I�.�/���Y�F��d�#�D��[�[�F��A�:��L�L���t�}�}�5�5�d�;�<��I�I���I��z�z�$����1�D�H��K�K�6�!�K��
r+c��|j�|jtk7rddl}t	|j
d��|jj|�S)Nrz$read() on write-only GzipFile object)r�r#rlr�r�r�r6r�r;rAr�s   r*rz
GzipFile.readMsD����� ��9�9�����%�+�+�'M�N�N��|�|� � ��&�&r+c���	|j�|jtk7rddl}t	|j
d��|dkrtj}|jj|�S)Nrz%read1() on write-only GzipFile object)
r�r#rlr�r�r�r�DEFAULT_BUFFER_SIZEr6�read1r�s   r*r�zGzipFile.read1Ts^��	E�	
��� ��9�9�����%�+�+�'N�O�O��!�8��)�)�D��|�|�!�!�$�'�'r+c��|j�|jtk7rddl}t	|j
d��|jj|�S)Nrz$peek() on write-only GzipFile object)r�r#rlr�r�r�r6�peek)r;�nr�s   r*r�z
GzipFile.peekasD����� ��9�9�����%�+�+�'M�N�N��|�|� � ��#�#r+c��|jduSr@)r}rIs r*�closedzGzipFile.closedhs���|�|�t�#�#r+c���|j}|�y	|jtk(rs|jj	�|j|jj	��t||j�t||jdz�n-|jtk(r|jj�|j�y#|j�wxYw)N���)
r}r#rrr6r�rrr1r�rArl�closer)r;r}s  r*r�zGzipFile.closels����,�,���?��
	��y�y�E�!����"�"�$��
�
�d�m�m�1�1�3�4���$�(�(�+���$�)�)�j�"8�9����d�"����"�"�$��K�K�M��D�K�K�M�s�B3C�C'c�^�d|_|j}|�d|_|j�yyr@)r}rhr�)r;rhs  r*rzGzipFile._close|s.������N�N�	�� �!�D�N��O�O��!r+c��|j�|jtk(ri|jj	�|j
j
|jj	|��|j
j	�yyr@)r�r#rrr6r�r}rr)r;�	zlib_modes  r*r�zGzipFile.flush�s`����� ��9�9����L�L��� ��L�L���t�}�}�2�2�9�=�>��L�L��� �	r+c�8�	|jj�Sr@)r}�filenorIs r*r�zGzipFile.fileno�s��	�
�|�|�"�"�$�$r+c�x�	|jtk7rtd��|jj	d�y)NzCan't rewind in write moder)r#rlr�r6rDrIs r*�rewindzGzipFile.rewind�s1��	!��9�9����6�7�7������!�r+c�(�|jtk(Sr@)r#rlrIs r*�readablezGzipFile.readable�s���y�y�D� � r+c�(�|jtk(Sr@)r#rrrIs r*r\zGzipFile.writable�s���y�y�E�!�!r+c��yrGrHrIs r*rJzGzipFile.seekable�rKr+c��|jtk(r�|j�|jj	�|t
jk7r.|t
jk(r|j|z}ntd��||jkrtd��||jz
}d|jz}t||jz�D]}|j|��|jd||jzz�|jS|jtk(r,|j�|jj||�S|jS)NzSeek from end not supportedzNegative seek in write moder�)r#rrr�r6r�r�SEEK_SET�SEEK_CURr�rr�r{�rangerrlrD)r;r��whence�count�chunk�is      r*rDz
GzipFile.seek�s���9�9����"�"�$��L�L��� �����$��R�[�[�(�!�[�[�6�1�F�$�%B�C�C�����#��;�<�<��T�[�[�(�E��D�-�-�-�E��5�D�$5�$5�5�6���
�
�5�!�7��J�J�u���(9�(9� 9�:�;�
�{�{��	�Y�Y�$�
��"�"�$��<�<�$�$�V�V�4�4��{�{�r+c�X�|j�|jj|�Sr@)r�r6�readline)r;rAs  r*r�zGzipFile.readline�s#����� ��|�|�$�$�T�*�*r+�r�)!rLrMrNrhr�r>�propertyr�r�rsr�r~rrXrr�r�r�r�rrt�Z_SYNC_FLUSHr�r�r�r�r\rJrr�rDr��
__classcell__�r�s@r*rr�s������I� $�4�3�T��Z�x�,��,�>���
0�@	(��"'�(�$��$��$�� �"�.�.�!�%��!�"��#%�+�+��.+r+rc���	|j|�}t|�|kr>|j|t|�z
�}|std��||z
}t|�|kr�>|S)N�ACompressed file ended before the end-of-stream marker was reached)rr7�EOFError)�fpr�rYrs    r*�_read_exactr��si���
�7�7�1�:�D�

�d�)�a�-��G�G�A��D�	�M�"����>�?�
?���	���d�)�a�-��Kr+c���	|jd�}|dk(ry|dk7rtd|z��tjdt	|d��\}}}|dk7rtd��|t
zr.tjdt	|d��\}t	||�|tzr	|jd	�}|r|d
k(rn�|tzr	|jd	�}|r|d
k(rn�|tzrt	|d�|S)Nr	r+r�zNot a gzipped file (%r)z<BBIxxrzUnknown compression methodz<Hrr�)	rrr-�unpackr��FEXTRAr��FCOMMENT�FHCRC)r��magic�method�flag�
last_mtime�	extra_lenr�s       r*�_read_gzip_headerr��s����
�G�G�A�J�E���|������3�e�;�<�<�!'���x��R��9K�!L��V�T�:�
��{��6�7�7��f�}��]�]�4��R��);�<�
�	��B�	�"��e�|������
�A���7�
����h�������
�A���7�
����e�|��B����r+c�B��eZdZ�fd�Zd�Zd�Zdd�Zd�Z�fd�Z�xZ	S)rmc���t�|�t|�tjtj
��d|_d|_y)N��wbitsT)r�r>r3rt�_ZlibDecompressorrw�_new_memberr�)r;r�r�s  �r*r>z_GzipReader.__init__�s>���
����R��$�*@�*@� $����	�	0� �����r+c�F�tjd�|_d|_yr�)rtr��_crc�_stream_sizerIs r*�
_init_readz_GzipReader._init_read�s���J�J�s�O��	���r+c�B�t|j�}|�y||_y)NFT)r��_fpr�)r;r�s  r*r�z_GzipReader._read_gzip_headers$��&�t�x�x�0�
����%���r+c��|dkr|j�S|sy	|jjr8|j�d|_|j
di|j��|_|jr9|j�|j�s|j|_
yd|_|jjr<|jjt�}|jj||�}n|jjd|�}|jj dk7r/|jj#|jj �|dk7rndk(rt%d����at'j(||j*�|_|xj,t/|�z
c_|xjt/|�z
c_	|S)Nrr+TFr�rH)�readall�
_decompressor�eof�	_read_eofr��_decomp_factory�_decomp_argsr�r��_pos�_size�needs_inputr�r�READ_BUFFER_SIZEr�unused_datar=r�rtr�r�r�r7)r;rA�buf�
uncompresss    r*rz_GzipReader.reads����!�8��<�<�>�!���
��!�!�%�%�
��� �#'�� �%9�T�%9�%9�&)��'�'�&)��"�������!��-�-�/�!%���D�J��#(�� ��!�!�-�-��h�h�m�m�$4�5��!�/�/�:�:�3��E�
�!�/�/�:�:�3��E�
��!�!�-�-��4���� � ��!3�!3�!?�!?�@��S� ���c�z�� B�C�C�G�L�J�J�z�4�9�9�5��	����S��_�,���	�	�S��_�$�	��r+c��tjdt|jd��\}}||jk7r-tdt
|��dt
|j�����||jdzk7rtd��d}|dk(r!|jjd�}|dk(r�!|r|jj|�yy)	N�<IIrzCRC check failed z != r��!Incorrect length of data producedr�r)
r-r�r�r�r�rr�r�rr=)r;r��isize�cs    r*rz_GzipReader._read_eof<s���
�}�}�U�K����!�,D�E���u��D�I�I���S��Z�=@����^�M�N�
N�
�t�(�(�:�5�
6��A�B�B�

���7�l����
�
�a� �A��7�l���H�H���Q��
r+c�0��t�|��d|_yrG)r��_rewindr�r�s �r*rz_GzipReader._rewindQs���
������r+r�)
rLrMrNr>r�r�rrrr�r�s@r*rmrm�s'��� ���3�j �* � r+rmr$�returnc
��	|�tj�}|tk(rd}n|tk(rd}nd}tjdddddt|�|d�S)	Nr	r
rz<BBBBLBB��r�)r�r�r�r-r.r�)r$r�r�s   r*�_create_simple_gzip_headerrVs]���
�}��	�	����,�,���	�.�	.������;�;�z�4��q�!�S��Z��c�J�Jr+)r�c��	|dk(rtj||d��St||�}tjdtj
|�t
|�dz�}|tj||d��z|zS)Nrr)�levelr�z<LLr�i�)rtrrr-r.r�r7)rYr$r��header�trailers     r*rrksw���
��z��}�}�T��b�A�A�
'�
�u�
=�F��k�k�%����D�!1�C��I�
�4J�L�G��T�]�]�4�}�C�H�H��
�r+c��	g}	tj|�}t|��dj|�St	j
tj��}|j||j�d�}|jrt|j�dkrtd��tjd|jdd�\}}|t	j|�k7rt!d��|t|�dzk7rt!d��|j#|�|jddj%d	�}��=)
Nr+r�rr�r
zCRC check failedr�rr�)r�BytesIOr��joinrt�
decompressobjrwrr�rr7r	r�r-r�r�r�append�lstrip)rY�decompressed_membersr��do�decompressedr�r�s       r*rr}s�����
�
�Z�Z��
���R� �(��8�8�0�1�1�
�
�
�t�~�~�o�
6���}�}�T�"�'�'�)�*�%5�6���v�v��R�^�^�,�q�0��0�1�
1��m�m�E�2�>�>�"�1�+=�>���V��$�*�*�\�*�*��0�1�1��c�,�'�*�4�5��A�B�B��#�#�L�1��~�~�a�b�!�(�(��1��#r+c��ddlm}|d��}|j�}|jddd��|jd	dd
��|jdddd
��|jdddgd��|j	�}t
}|jrt}n|jrt}|jD�]�}|jr�|dk(rAtddtjj��}tj j}n�|dddk7rtj"d|���t%|d�}t'j$|ddd�}nl|dk(rBtjj}tddtj j|��}n%t'j$|d�}t%|dzd�}	|j)t*�}|sn|j-|��*|tj jur|j/�|tjjus��}|j/����y)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)�descriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r9)�nargs�default�metavarrr)r"r#r}r�z.gzzfilename doesn't end in .gz: �wb)r"r#r}r$)�argparser'�add_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFF�fastr��bestr�r,rr�sys�stdin�buffer�stdout�exitrrgrrrr�)	r'�parser�groupr,r$�argr<�gr�s	         r*�mainrC�s���'�
�	,�-�F�
�/�/�1�E�	���x��;L��M�	���x��;L��M�	���t�^�L�>��@�����c�C�5�&��I�����D�,�M��y�y�,�
�	
���,�
��y�y���?�?��c�z��b�t�S�Y�Y�=M�=M�N���J�J�%�%���r�s�8�u�$��H�H�<�S�G�D�E���d�O���M�M�#�c�r�(�D�1���c�z��I�I�$�$���b�t�S�Z�Z�=N�=N�+8�:���M�M�#�t�,����u��d�+����F�F�+�,�E���
�G�G�E�N�	�

�C�J�J�%�%�%�
�G�G�I��C�I�I�$�$�$�
�G�G�I�5r+�__main__r@)+�_compressionrgrrr-r:r�rSrt�__all__�FTEXTr�r�r�r�rlrrr�r7r�rr�rzrr1r3r�r�	RawIOBaserQ�
BaseStreamrr�r��DecompressReaderrmr�rrrrrCrLrHr+r*�<module>rKs2��%���	�	�
�
����
G��(6�%��u�f�e�X����e�����������/�/�/���,@��t�T�+�Z+�
'�'�TA�'�A������$j+�|�&�&�j+�Z	
� "�J_ �,�/�/�_ �F(,�K�c�K�05�K�*"6����$2�2.�`�z���F�r+

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists