Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/PIL/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/PIL/__pycache__/ContainerIO.cpython-312.pyc

�

&ٜg���T�ddlmZddlZddlmZddlmZmZmZGd�dee�Z	y)�)�annotationsN)�Iterable)�IO�AnyStr�NoReturnc���eZdZdZdd�Zdd�Zdd�Zejfdd�Z	dd�Z
dd�Zddd�Zddd	�Z
ddd
�Zdd�Zdd�Zdd
�Zd d!d�Zd"d�Zd#d�Zd"d�Zd$d�Zdd�Zd%d�Zd%d�Zy)&�ContainerIOzm
    A file object that provides read access to a part of an existing
    file (for example a TAR file).
    c�r�||_d|_||_||_|jj	|�y)z�
        Create file object.

        :param file: Existing file.
        :param offset: Start of region, in bytes.
        :param length: Size of region, in bytes.
        rN)�fh�pos�offset�length�seek)�self�filer
rs    �:/usr/local/lib/python3.12/site-packages/PIL/ContainerIO.py�__init__zContainerIO.__init__s0��#�����������������V��c��y�NF��rs r�isattyzContainerIO.isatty.���rc��y�NTrrs r�seekablezContainerIO.seekable1���rc�R�|dk(r|j|z|_n!|dk(r|j|z|_n||_tdt|j|j��|_|jj|j|jz�|jS)aK
        Move file pointer.

        :param offset: Offset in bytes.
        :param mode: Starting position. Use 0 for beginning of region, 1
           for current offset, and 2 for end of region.  You cannot move
           the pointer outside the defined region.
        :returns: Offset from start of region, in bytes.
        ��r)rr�max�minrrr
)rr
�modes   rrzContainerIO.seek4s|���1�9��x�x�&�(�D�H�
�Q�Y��{�{�V�+�D�H��D�H��q�#�d�h�h����4�5��������T�[�[�4�8�8�+�,��x�x�rc��|jS)ze
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        )rrs r�tellzContainerIO.tellIs
���x�x�rc��yrrrs r�readablezContainerIO.readableQrrc�&�|dkDr$t||j|jz
�}n|j|jz
}|dkrd|jjvrdSdS|j|z|_|jj|�S)z�
        Read data.

        :param n: Number of bytes to read. If omitted, zero or negative,
            read until end of region.
        :returns: An 8-bit string.
        r�br�)r#rrrr$�read)r�ns  rr,zContainerIO.readTsx��
�q�5��A�t�{�{�T�X�X�-�.�A����d�h�h�&�A���6�������-�3�5�2�5��8�8�a�<����w�w�|�|�A��rc���d|jjvrdnd}d|jjvrdnd}	|jd�}|s	|S||z}||k(st|�|k(r	|S�2)z�
        Read a line of text.

        :param n: Number of bytes to read. If omitted, zero or negative,
            read until end of line.
        :returns: An 8-bit string.
        r*rr+�
�
r )rr$r,�len)rr-�s�newline_character�cs     r�readlinezContainerIO.readlineesy���$�'�'�,�,�.�C�B��%(�D�G�G�L�L�%8�E�d����	�	�!��A������A��A��%�%��Q��1�����rc�x�g}	|j�}|s	|S|j|�t|�|k(r	|S�8)z�
        Read multiple lines of text.

        :param n: Number of lines to read. If omitted, zero, negative or None,
            read until end of region.
        :returns: A list of 8-bit strings.
        )r5�appendr1)rr-�linesr2s    r�	readlineszContainerIO.readlinesxsI������
�
��A�����
�L�L��O��5�z�Q�����rc��yrrrs r�writablezContainerIO.writable�rrc��t���N��NotImplementedError)rr*s  r�writezContainerIO.write����!�#�#rc��t��r=r>)rr8s  r�
writelineszContainerIO.writelines�rArNc��t��r=r>)r�sizes  r�truncatezContainerIO.truncate�rArc��|Sr=rrs r�	__enter__zContainerIO.__enter__�����rc�$�|j�yr=)�close)r�argss  r�__exit__zContainerIO.__exit__�s���
�
�rc��|Sr=rrs r�__iter__zContainerIO.__iter__�rIrc�D�|j�}|s
d}t|��|S)Nz
end of region)r5�
StopIteration)r�line�msgs   r�__next__zContainerIO.__next__�s%���}�}����!�C���$�$��rc�6�|jj�Sr=)r�filenors rrVzContainerIO.fileno�s���w�w�~�~��rc�8�|jj�yr=)r�flushrs rrXzContainerIO.flush�������
�
�rc�8�|jj�yr=)rrKrs rrKzContainerIO.close�rYr)rz
IO[AnyStr]r
�intrr[�return�None)r\�bool)r
r[r$r[r\r[)r\r[)���)r-r[r\r)r-�
int | Noner\zlist[AnyStr])r*rr\r)r8zIterable[AnyStr]r\rr=)rEr`r\r[)r\zContainerIO[AnyStr])rL�objectr\r])r\r)r\r])�__name__�
__module__�__qualname__�__doc__rrr�io�SEEK_SETrr&r(r,r5r9r;r@rCrFrHrMrOrTrVrXrKrrrr	r	st���
�"��-/�K�K��*���"�&�$�$�$�$����� ��rr	)
�
__future__rrf�collections.abcr�typingrrrr	rrr�<module>rks(�� #�	�$�'�'�V�"�V�*�Vr

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists