AlkantarClanX12

Your IP : 18.222.92.56


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/bz2.cpython-37.opt-2.pyc

B

YI~dz0�@s�ddddddgZdZddlmZdd	lZdd	lZdd	lZdd	lZdd
l	m
Z
ddlmZm
Z
dZdZd
ZGdd�dej�Zddd�Zddd�Zdd�Zd	S)�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZd(dd�Zdd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
d)dd�Zd*dd�Zd+dd�Z
dd�Zd,dd�Zd-dd�Zd d!�Zd"d#�Zejfd$d%�Zd&d'�ZdS).r�rN�	cCsPt�|_d|_d|_t|_|dk	r.t�dt�d|krBdksLnt	d��|dkr^d}t
}nb|dkrzd	}t}t|�|_
nF|d
kr�d}t}t|�|_
n*|dkr�d
}t}t|�|_
nt	d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jt
k�rFtj|jttd�}t�|�|_nd|_dS)NFz)Use of 'buffering' argument is deprecatedr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abrzInvalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r7�(/opt/alt/python37/lib64/python3.7/bz2.py�__init__'sL
zBZ2File.__init__cCs�|j��|jtkrdSz<|jtkr.|j��n"|jtkrP|j�|j	�
��d|_	Wdz|jrf|j��Wdd|_d|_t|_d|_XXWdQRXdS)NF)rrrr r/�closer!rrr"�flushr)r1r7r7r8r:ls 



z
BZ2File.closecCs
|jtkS)N)rr)r1r7r7r8�closed�szBZ2File.closedcCs|��|j��S)N)�_check_not_closedr�fileno)r1r7r7r8r>�szBZ2File.filenocCs|��o|j��S)N)�readabler/�seekable)r1r7r7r8r@�szBZ2File.seekablecCs|��|jtkS)N)r=rr )r1r7r7r8r?�szBZ2File.readablecCs|��|jtkS)N)r=rr!)r1r7r7r8�writable�szBZ2File.writablerc	Cs&|j�|��|j�|�SQRXdS)N)r�_check_can_readr/�peek)r1�nr7r7r8rC�szBZ2File.peek���c	Cs&|j�|��|j�|�SQRXdS)N)rrBr/r)r1�sizer7r7r8r�szBZ2File.readc	Cs4|j�$|��|dkrtj}|j�|�SQRXdS)Nr)rrBr-�DEFAULT_BUFFER_SIZEr/�read1)r1rFr7r7r8rH�s
z
BZ2File.read1c	Cs&|j�|��|j�|�SQRXdS)N)rrBr/�readinto)r1�br7r7r8rI�szBZ2File.readintoc	CsJt|t�s$t|d�std��|��}|j�|��|j�|�SQRXdS)N�	__index__zInteger argument expected)	r#�intr)r*rKrrBr/�readline)r1rFr7r7r8rM�s

zBZ2File.readlinec	CsJt|t�s$t|d�std��|��}|j�|��|j�|�SQRXdS)NrKzInteger argument expected)	r#rLr)r*rKrrBr/�	readlines)r1rFr7r7r8rN�s

zBZ2File.readlinesc	CsL|j�<|��|j�|�}|j�|�|jt|�7_t|�SQRXdS)N)rZ_check_can_writer"rrrr0�len)r1�dataZ
compressedr7r7r8r�sz
BZ2File.writec	Cs |j�tj�||�SQRXdS)N)rr+�
BaseStream�
writelines)r1�seqr7r7r8rR�szBZ2File.writelinesc	Cs(|j�|��|j�||�SQRXdS)N)rZ_check_can_seekr/�seek)r1�offset�whencer7r7r8rTszBZ2File.seekc	Cs4|j�$|��|jtkr$|j��S|jSQRXdS)N)rr=rr r/�tellr0)r1r7r7r8rWs


zBZ2File.tell)rNr)r)rE)rE)rE)rE)�__name__�
__module__�__qualname__r9r:�propertyr<r>r@r?rArCrrHrIrMrNrrRr-�SEEK_SETrTrWr7r7r7r8rs"
E




	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d�}d|kr�t�||||�S|SdS)	N�trJzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder
)r5)r�replacerr-�
TextIOWrapper)r2r3r5�encoding�errors�newlineZbz_modeZbinary_filer7r7r8rscCst|�}|�|�|��S)N)rrr;)rPr5�compr7r7r8rFscCsjg}xZ|r^t�}y|�|�}Wntk
r<|r6Pn�YnX|�|�|jsVtd��|j}qWd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rrr,�append�eofrZunused_data�join)rP�resultsZdecompZresr7r7r8rQs

)rrNNN)r)�__all__�
__author__�builtinsrr(r-r&rr+Z	threadingrZ_bz2rrrr r!rQrrrr7r7r7r8�<module>s&

(