
    ,h                    T    d dl mZ d dlZd dlmZ d dlmZmZmZ  G d dee         Z	y)    )annotationsN)Iterable)IOAnyStrNoReturnc                      e Zd ZdZddZddZddZej                  fddZ	ddZ
ddZdddZddd	Zddd
ZddZddZddZd d!dZd"dZd#dZd"dZd$dZddZd%dZd%dZy)&ContainerIOzm
    A file object that provides read access to a part of an existing
    file (for example a TAR file).
    c                r    || _         d| _        || _        || _        | j                   j	                  |       y)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       Q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/PIL/ContainerIO.py__init__zContainerIO.__init__   s0     #V    c                     yNF r   s    r   isattyzContainerIO.isatty.       r   c                     yNTr   r   s    r   seekablezContainerIO.seekable1       r   c                R   |dk(  r| j                   |z   | _         n!|dk(  r| j                  |z   | _         n|| _         t        dt        | j                   | j                              | _         | j                  j                  | j                  | j                   z          | j                   S )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minr   r   r   )r   r   modes      r   r   zContainerIO.seek4   s|     19xx&(DHQY{{V+DHDHq#dhh45T[[488+,xxr   c                    | j                   S )ze
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        )r   r   s    r   tellzContainerIO.tellI   s     xxr   c                     yr   r   r   s    r   readablezContainerIO.readableQ   r   r   c                &   |dkD  r$t        || j                  | j                  z
        }n| j                  | j                  z
  }|dk  rd| j                  j                  v rdS dS | j                  |z   | _        | j                  j                  |      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#   r   r   r   r$   read)r   ns     r   r,   zContainerIO.readT   sx     q5At{{TXX-.Adhh&A6-352588a<ww||Ar   c                    d| j                   j                  v rdnd}d| j                   j                  v rdnd}	 | j                  d      }|s	 |S ||z   }||k(  st        |      |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*   r   r+      

r    )r   r$   r,   len)r   r-   snewline_charactercs        r   readlinezContainerIO.readlinee   sy     $'',,.CB%(DGGLL%8Ed		!A  AA%%Q1 r   c                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   )r   r-   linesr2   s       r   	readlineszContainerIO.readlinesx   sI     A  LLO5zQ r   c                     yr   r   r   s    r   writablezContainerIO.writable   r   r   c                    t               NNotImplementedError)r   r*   s     r   writezContainerIO.write       !##r   c                    t               r=   r>   )r   r8   s     r   
writelineszContainerIO.writelines   rA   r   Nc                    t               r=   r>   )r   sizes     r   truncatezContainerIO.truncate   rA   r   c                    | S r=   r   r   s    r   	__enter__zContainerIO.__enter__       r   c                $    | j                          y r=   )close)r   argss     r   __exit__zContainerIO.__exit__   s    

r   c                    | S r=   r   r   s    r   __iter__zContainerIO.__iter__   rI   r   c                D    | j                         }|sd}t        |      |S )Nzend of region)r5   StopIteration)r   linemsgs      r   __next__zContainerIO.__next__   s%    }}!C$$r   c                6    | j                   j                         S r=   )r   filenor   s    r   rV   zContainerIO.fileno   s    ww~~r   c                8    | j                   j                          y r=   )r   flushr   s    r   rX   zContainerIO.flush       r   c                8    | j                   j                          y r=   )r   rK   r   s    r   rK   zContainerIO.close   rY   r   )r   z
IO[AnyStr]r   intr   r[   returnNone)r\   bool)r   r[   r$   r[   r\   r[   )r\   r[   ))r-   r[   r\   r   )r-   
int | Noner\   zlist[AnyStr])r*   r   r\   r   )r8   zIterable[AnyStr]r\   r   r=   )rE   r`   r\   r[   )r\   zContainerIO[AnyStr])rL   objectr\   r]   )r\   r   )r\   r]   )__name__
__module____qualname____doc__r   r   r   ioSEEK_SETr   r&   r(   r,   r5   r9   r;   r@   rC   rF   rH   rM   rO   rT   rV   rX   rK   r   r   r   r	   r	      st    
" -/KK *"&$$$$ r   r	   )

__future__r   rf   collections.abcr   typingr   r   r   r	   r   r   r   <module>rk      s(     # 	 $ ' 'V"V* Vr   