OwlCyberSecurity - MANAGER
Edit File: _compression.cpython-36.pyc
3 � \�������������������@���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.6/_compression.py�_check_not_closed���s����zBaseStream._check_not_closedc�������������C���s���|�j���stjd��d�S�)NzFile not open for reading)�readable�io�UnsupportedOperation)r���r���r���r����_check_can_read���s����zBaseStream._check_can_readc�������������C���s���|�j���stjd��d�S�)NzFile not open for writing)�writabler ���r���)r���r���r���r����_check_can_write���s����zBaseStream._check_can_writec�������������C���s(���|�j���stjd��|�j��s$tjd��d�S�)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r ���r ���r����seekable)r���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�������������������sl���e�Zd�ZdZdd��Zf�fdd�Z��fdd�Zdd ��Zd d��Zdd d�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.readablec�������������K���s>���||�_�d|�_d|�_d|�_||�_||�_|�jf�|�j�|�_||�_d�S�)NFr����������)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args� _decompressor�_trailing_error)r����fpZdecomp_factoryZtrailing_errorZdecomp_argsr���r���r����__init__'���s����zDecompressReader.__init__c����������������s���d�|�_�t��j��S�)N)r����super�close)r���)� __class__r���r���r#���;���s����zDecompressReader.closec�������������C���s ���|�j�j��S�)N)r���r���)r���r���r���r���r���?���s����zDecompressReader.seekablec�������������C���sP���t�|��:}|jd��$}|�jt|��}||d�t|��<�W�d�Q�R�X�W�d�Q�R�X�t|�S�)N�B)� memoryview�cast�read�len)r����bZviewZ byte_view�datar���r���r����readintoB���s����$zDecompressReader.readintor���c�������������C���s����|dk�r|�j���S�|�s|�jr dS�d�}x�|�jjr�|�jjp@|�jjt�}|sHP�|�jf�|�j �|�_y|�jj ||�}W�q��|�jk r����P�Y�q�X�n4|�jjr�|�jjt�}|s�t d��nd}|�jj ||�}|r&P�q&W�|s�d|�_|�j|�_dS�|��jt|�7��_|S�)Nr��������zACompressed file ended before the end-of-stream marker was reachedT)�readallr���r����eofZunused_datar���r(����BUFFER_SIZEr���r���Z decompressr���Zneeds_input�EOFErrorr���r���r)���)r����sizer+���Zrawblockr���r���r���r(���H���s>���� zDecompressReader.readc�������������C���s,���|�j�jd��d|�_d|�_|�jf�|�j�|�_d�S�)Nr���F)r����seekr���r���r���r���r���)r���r���r���r����_rewindr���s����zDecompressReader._rewindc�������������C���s����|t�jkrnV|t�jkr"|�j|�}n@|t�jkrT|�jdk�rHx|�jt�j�rFq8W�|�j|�}ntdj |���||�jk�rv|�j ���n ||�j8�}x0|dkr�|�jtt�j|��}|s�P�|t|�8�}q�W�|�jS�)Nr���zInvalid value for whence: {}) r ����SEEK_SET�SEEK_CURr����SEEK_ENDr���r(����DEFAULT_BUFFER_SIZEr����formatr4����minr)���)r����offset�whencer+���r���r���r���r3���x���s&���� zDecompressReader.seekc�������������C���s���|�j�S�)z!Return the current file position.)r���)r���r���r���r����tell����s����zDecompressReader.tellr���)r���)r���r���r���r���r ���r!���r#���r���r,���r(���r4���r ���r5���r3���r=���� __classcell__r���r���)r$���r���r���!���s��� *r���)r���r ���r8���r0����BufferedIOBaser���� RawIOBaser���r���r���r���r����<module>���s���