
    thC                     (    d dl Z  G d d          ZdS )    Nc                   L    e Zd ZdZd Zd Zej        fdZd Z	ddZ
d Zd	 Zd
S )ContainerIOzm
    A file object that provides read access to a part of an existing
    file (for example a TAR file).
    c                 r    || _         d| _        || _        || _        | j                             |           dS )z
        Create file object.

        :param file: Existing file.
        :param offset: Start of region, in bytes.
        :param length: Size of region, in bytes.
        r   N)fhposoffsetlengthseek)selffiler   r	   s       c/var/www/html/mycamper/aliexpress-site/backend/venv/lib/python3.11/site-packages/PIL/ContainerIO.py__init__zContainerIO.__init__   s:     V    c                     dS )NF r   s    r   isattyzContainerIO.isatty,   s    ur   c                    |dk    r| j         |z   | _         n|dk    r| j        |z   | _         n|| _         t          dt          | j         | j                            | _         | j                            | j        | j         z              dS )a  
        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.
              r   N)r   r	   maxminr   r
   r   )r   r   modes      r   r
   zContainerIO.seek/   s     199x&(DHHQYY{V+DHHDHq#dh4455T[48+,,,,,r   c                     | j         S )ze
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        )r   r   s    r   tellzContainerIO.tellB   s     xr   r   c                     |rt          || j        | j        z
            }n| j        | j        z
  }|sd| j        j        v rdndS | j        |z   | _        | j                            |          S )z
        Read data.

        :param n: Number of bytes to read. If omitted or zero,
            read until end of region.
        :returns: An 8-bit string.
        br    )r   r	   r   r   r   read)r   ns     r   r   zContainerIO.readJ   ss      	'At{TX-..AAdh&A 	6--33258a<w||Ar   c                     d| j         j        v rdnd}d| j         j        v rdnd}	 |                     d          }|sn||z   }||k    rn%|S )zJ
        Read a line of text.

        :returns: An 8-bit string.
        r   r   r      

Tr   )r   r   r   )r   snewline_charactercs       r   readlinezContainerIO.readline[   sv     $',&&CCB%(DGL%8%8EEd			!A AA%%%	 r   c                 f    g }	 |                                  }|sn|                    |           -|S )zZ
        Read multiple lines of text.

        :returns: A list of 8-bit strings.
        )r'   append)r   linesr$   s      r   	readlineszContainerIO.readlinesl   sA     	A LLOOO		
 r   N)r   )__name__
__module____qualname____doc__r   r   ioSEEK_SETr
   r   r   r'   r+   r   r   r   r   r      s         
  "   !# - - - -&     "  "    r   r   )r0   r   r   r   r   <module>r2      sL   $ 
			c c c c c c c c c cr   