Your IP : 3.21.105.222


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/lzma.cpython-39.opt-2.pyc

a

R�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�eZdZd!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|_|dvrL|dkr*td��|dur:td��|durFt}t}n@|dvr~|dur`t}t}t	||||d�|_
d|_ntd	�|���t
|tttjf�r�d
|vr�|d
7}t�||�|_d|_||_n*t|d�s�t|d
�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)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/python39/lib64/python3.9/lzma.py�__init__1sF,�
�zLZMAFile.__init__cCs�|jtkrdSz~|jtkr,|j��d|_n"|jtkrN|j�|j�	��d|_Wz&|j
rb|j��Wd|_d|_
t|_q�d|_d|_
t|_0n>z&|j
r�|j��Wd|_d|_
t|_nd|_d|_
t|_00dS)NF)r"r!r$r3�closer%rrr&�flushr �r4r8r8r9r;�s6



�
��zLZMAFile.closecCs
|jtkS�N)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��Sr>)�_check_not_closedr�filenor=r8r8r9rA�szLZMAFile.filenocCs|��o|j��Sr>)�readabler3�seekabler=r8r8r9rC�szLZMAFile.seekablecCs|��|jtkSr>)r@r"r$r=r8r8r9rB�szLZMAFile.readablecCs|��|jtkSr>)r@r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�Sr>)�_check_can_readr3�peek�r4�sizer8r8r9rF�sz
LZMAFile.peekcCs|��|j�|�Sr>)rEr3rrGr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)Nr
)rEr1�DEFAULT_BUFFER_SIZEr3�read1rGr8r8r9rJ�szLZMAFile.read1cCs|��|j�|�Sr>)rEr3�readlinerGr8r8r9rK�szLZMAFile.readlinecCsX|��t|ttf�r t|�}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�whencer8r8r9rQ�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jSr>)r@r"r$r3�tellr'r=r8r8r9rTs

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__r:r;�propertyr?rArCrBrDrFrrJrKrr1�SEEK_SETrQrTr8r8r8r9r&s"�U


	


rrr)rrrr�encoding�errors�newlinecCs�d|vr d|vrPtd|f��n0|dur0td��|dur@td��|durPtd��|�dd�}	t||	||||d�}
d|vr�t�|
|||�S|
SdS)	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�
TextIOWrapper)r5r6rrrrrZr[r\Zlz_modeZbinary_filer8r8r9rs 
�rcCs t||||�}|�|�|��Sr>)rrr<)rPrrrr�compr8r8r9r>srcCsng}t|||�}z|�|�}Wnty<|r6Yqdn�Yn0|�|�|jsVtd��|j}|sqdqd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rPrZmemlimitrZresultsZdecomp�resr8r8r9r	Js
r	)r)�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>s"
j�/

?>