a
´iÜ ã @ s: d Z ddlZejZG dd„ dejƒZG dd„ dejƒZdS )z7Internal classes used by the gzip, lzma and bz2 modulesé Nc @ s0 e Zd ZdZdd„ Zdd„ Zdd„ Zdd „ Zd
S )Ú
BaseStreamzMode-checking helper functions.c C s | j rtdƒ‚d S )NzI/O operation on closed file)ÚclosedÚ
ValueError©Úself© r ú$/usr/lib64/python3.9/_compression.pyÚ_check_not_closed s zBaseStream._check_not_closedc C s | ¡ st d¡‚d S )NzFile not open for reading)ÚreadableÚioÚUnsupportedOperationr r r r Ú_check_can_read s zBaseStream._check_can_readc C s | ¡ st d¡‚d S )NzFile not open for writing)Úwritabler r r r r r Ú_check_can_write s zBaseStream._check_can_writec C s( | ¡ st d¡‚| ¡ s$t d¡‚d S )Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
r r Úseekabler r r r Ú_check_can_seek s
zBaseStream._check_can_seekN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r
r r r r r r r s
r c sj e Zd ZdZdd„ Zddd„Z‡ fdd„Zd d
„ Zdd„ Zddd„Z dd„ Z
ejfdd„Z
dd„ Z‡ ZS )ÚDecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIc C s dS )NTr r r r r r
$ s zDecompressReader.readabler c K sB || _ d| _d| _d| _|| _|| _| jf i | j¤Ž| _|| _d S )NFr éÿÿÿÿ)Ú_fpÚ_eofÚ_posÚ_sizeÚ_decomp_factoryÚ_decomp_argsÚ
_decompressorÚ_trailing_error)r ÚfpÚdecomp_factoryÚtrailing_errorÚdecomp_argsr r r Ú__init__' s zDecompressReader.__init__c s d | _ tƒ ¡ S ©N)r ÚsuperÚcloser ©Ú __class__r r r' ; s zDecompressReader.closec C s
| j ¡ S r% )r r r r r r r ? s zDecompressReader.seekablec C sx t |ƒ�X}| d¡�.}| t|ƒ¡}||d t|ƒ…<