Your IP : 3.143.24.110


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

o

6��f�3�	@s�	gd�ZddlZddlZddlZddlTddlmZmZddlZdZdZ	dZ
Gdd�dej�Zddd
dddddd�dd
�Z
ed
ddfdd�Zeddfdd�ZdS))$Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZ	d!ddddd�dd�Zdd�Zed	d
��Zdd�Zd
d�Zdd�Z	dd�Z
d"dd�Zd"dd�Zd"dd�Z
d"dd�Zdd�Zejfdd�Zdd �ZdS)#rN�r�����format�check�preset�filtersc	Cs*	d|_d|_t|_|dvr'|dkrtd��|durtd��|dur$t}t}n |dvr@|dur1t}t}t	||||d�|_
d|_ntd	�|���t
|tttjf�rfd
|vrX|d
7}t�||�|_d|_||_nt|d�spt|d
�rw||_||_ntd��|jtkr�tj|jtt||d�}t�|�|_dSdS)NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�+/opt/alt/python310/lib64/python3.10/lzma.py�__init__1sJ*�

��zLZMAFile.__init__cCs�	|jtkrdSzK|jtkr|j��d|_n|jtkr(|j�|j�	��d|_Wz |j
r>|j��Wd|_d|_
t|_dSWd|_d|_
t|_dSd|_d|_
t|_wz|j
rh|j��Wd|_d|_
t|_wWd|_d|_
t|_wd|_d|_
t|_w)NF)r"r!r$r3�closer%rrr&�flushr �r4r8r8r9r;�sJ



�
�
����zLZMAFile.closecCs	|jtkS�N)r"r!r=r8r8r9�closed�s
zLZMAFile.closedcCs	|��|j��Sr>)�_check_not_closedr�filenor=r8r8r9rA��
zLZMAFile.filenocCs	|��o	|j��Sr>)�readabler3�seekabler=r8r8r9rD�szLZMAFile.seekablecC�	|��|jtkSr>)r@r"r$r=r8r8r9rC�rBzLZMAFile.readablecCrEr>)r@r"r%r=r8r8r9�writable�rBzLZMAFile.writablecC�	|��|j�|�Sr>)�_check_can_readr3�peek�r4�sizer8r8r9rI�sz
LZMAFile.peekcCrGr>)rHr3rrJr8r8r9r�sz
LZMAFile.readcCs$	|��|dkrtj}|j�|�S)Nr
)rHr1�DEFAULT_BUFFER_SIZEr3�read1rJr8r8r9rM�s
zLZMAFile.read1cCrGr>)rHr3�readlinerJr8r8r9rN�szLZMAFile.readlinecCsZ	|��t|ttf�rt|�}nt|�}|j}|j�|�}|j	�
|�|j|7_|Sr>)Z_check_can_writer(r*�	bytearray�len�
memoryview�nbytesr&rrrr')r4�dataZlengthZ
compressedr8r8r9r�s
zLZMAFile.writecCs	|��|j�||�Sr>)Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rT�sz
LZMAFile.seekcCs$	|��|jtkr|j��S|jSr>)r@r"r$r3�tellr'r=r8r8r9rWs


z
LZMAFile.tell)Nr)r)�__name__�
__module__�__qualname__r:r;�propertyr?rArDrCrFrIrrMrNrr1�SEEK_SETrTrWr8r8r8r9r&s&	�U



	

rrr)rrrr�encoding�errors�newlinecCs�	d|vrd|vrtd|f��n|durtd��|dur!td��|dur)td��|�dd�}	t||	||||d�}
d|vrJt�|�}t�|
|||�S|
S)	N�trzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
text_encoding�
TextIOWrapper)r5r6rrrrr]r^r_Zlz_modeZbinary_filer8r8r9rs&�
�
rcCs"	t||||�}|�|�|��Sr>)rrr<)rSrrrr�compr8r8r9r?srcCsl	g}	t|||�}z|�|�}Wnty|rYn�w|�|�|js*td��|j}|s0nqd�|�S)NTzACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rSrZmemlimitrZresultsZdecomp�resr8r8r9r	Ks&�
�
r	)r)�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>s&

j�0

?>