
    h                    T    S SK Jr  S SKrS SKJr  S SKJrJrJr   " S S\\   5      r	g)    )annotationsN)Iterable)IOAnyStrNoReturnc                  
   \ rS rSrSrSS jrSS jrSS jr\R                  4SS jjr
SS jrSS jrSSS	 jjrSSS
 jjrSSS jjrSS jrS S jrS!S jrS"S#S jjrS$S jrS%S jrS$S jrS&S jrSS jrS'S jrS'S jrSrg)(ContainerIO   za
A file object that provides read access to a part of an existing
file (for example a TAR file).
c                l    Xl         SU l        X l        X0l        U R                   R	                  U5        g)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       A/var/www/html/env/lib/python3.13/site-packages/PIL/ContainerIO.py__init__ContainerIO.__init__   s*     #V    c                    gNF r   s    r   isattyContainerIO.isatty.       r   c                    gNTr   r   s    r   seekableContainerIO.seekable1       r   c                T   US:X  a  U R                   U-   U l         O!US:X  a  U R                  U-   U l         OXl         [        S[        U R                   U R                  5      5      U l         U R                  R                  U R                  U R                   -   5        U R                   $ )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.
:returns: Offset from start of region, in bytes.
      r   )r   r   maxminr   r   r   )r   r   modes      r   r   ContainerIO.seek4   sz     19xx&(DHQY{{V+DHHq#dhh45T[[488+,xxr   c                    U R                   $ )zM
Get current file pointer.

:returns: Offset from start of region, in bytes.
)r   r   s    r   tellContainerIO.tellI   s     xxr   c                    gr   r   r   s    r   readableContainerIO.readableQ   r"   r   c                ,   US:  a#  [        XR                  U R                  -
  5      nOU R                  U R                  -
  nUS::  a  SU R                  R                  ;   a  S$ S$ U R                  U-   U l        U R                  R                  U5      $ )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   r3   ContainerIO.readT   sv     q5A{{TXX-.Adhh&A6-352588a<ww||Ar   c                    SU R                   R                  ;   a  SOSnSU R                   R                  ;   a  SOSn U R                  S5      nU(       d   U$ X$-   nXC:X  d  [        U5      U:X  a   U$ M8  )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.
r1   r   r2      

r$   )r   r(   r3   len)r   r4   snewline_charactercs        r   readlineContainerIO.readlinee   st     $'',,.CB%(DGGLL%8Ed		!A  A%Q1 r   c                    / n U R                  5       nU(       d   U$ UR                  U5        [        U5      U:X  a   U$ M?  )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.
)r=   appendr9   )r   r4   linesr:   s       r   	readlinesContainerIO.readlinesx   sI     A  LLO5zQ r   c                    gr   r   r   s    r   writableContainerIO.writable   r   r   c                    [        5       eNNotImplementedError)r   r1   s     r   writeContainerIO.write       !##r   c                    [        5       erH   rI   )r   rA   s     r   
writelinesContainerIO.writelines   rM   r   Nc                    [        5       erH   rI   )r   sizes     r   truncateContainerIO.truncate   rM   r   c                    U $ rH   r   r   s    r   	__enter__ContainerIO.__enter__       r   c                $    U R                  5         g rH   )close)r   argss     r   __exit__ContainerIO.__exit__   s    

r   c                    U $ rH   r   r   s    r   __iter__ContainerIO.__iter__   rX   r   c                N    U R                  5       nU(       d  Sn[        U5      eU$ )Nzend of region)r=   StopIteration)r   linemsgs      r   __next__ContainerIO.__next__   s%    }}!C$$r   c                6    U R                   R                  5       $ rH   )r   filenor   s    r   rh   ContainerIO.fileno   s    ww~~r   c                8    U R                   R                  5         g rH   )r   flushr   s    r   rk   ContainerIO.flush       r   c                8    U R                   R                  5         g rH   )r   rZ   r   s    r   rZ   ContainerIO.close   rm   r   )r   r   r   r   )r   z
IO[AnyStr]r   intr   rp   returnNone)rq   bool)r   rp   r(   rp   rq   rp   )rq   rp   ))r4   rp   rq   r   )r4   
int | Nonerq   zlist[AnyStr])r1   r   rq   r   )rA   zIterable[AnyStr]rq   r   rH   )rR   ru   rq   rp   )rq   zContainerIO[AnyStr])r[   objectrq   rr   )rq   r   )rq   rr   )__name__
__module____qualname____firstlineno____doc__r   r   r    ioSEEK_SETr   r+   r.   r3   r=   rB   rE   rK   rO   rS   rV   r\   r_   re   rh   rk   rZ   __static_attributes__r   r   r   r	   r	      st    
" -/KK *"&$$$$ r   r	   )

__future__r   r|   collections.abcr   typingr   r   r   r	   r   r   r   <module>r      s(     # 	 $ ' 'V"V* Vr   