§
    þÜÒjØ  ã                  óv   — d dl mZ d dlZd dlmZmZ dZerd dlmZ d dlm	Z	m
Z
  G d„ dee         ¦  «        ZdS )	é    )ÚannotationsN)ÚIOÚAnyStrF)ÚIterable)ÚNoReturnÚSelfc                  óÈ   — e Zd ZdZd-d	„Zd.d„Zd.d„Zej        fd/d„Z	d0d„Z
d.d„Zd1d2d„Zd1d2d„Zd1d3d„Zd.d„Zd4d„Zd5d„Zd6d7d"„Zd8d$„Zd9d'„Zd8d(„Zd:d)„Zd0d*„Zd;d+„Zd;d,„Zd S )<ÚContainerIOzm
    A file object that provides read access to a part of an existing
    file (for example a TAR file).
    Úfileú
IO[AnyStr]ÚoffsetÚintÚlengthÚreturnÚNonec                ó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Úposr   r   Úseek)Úselfr   r   r   s       ú[C:\Users\johnn\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL/ContainerIO.pyÚ__init__zContainerIO.__init__!   s:   € ð #ˆŒØˆŒØˆŒØˆŒØŒ�Š�VÑÔÐÐÐó    Úboolc                ó   — dS ©NF© ©r   s    r   ÚisattyzContainerIO.isatty2   ó   € Øˆur   c                ó   — dS ©NTr   r   s    r   ÚseekablezContainerIO.seekable5   ó   € Øˆtr   Úmodec                ó  — |dk    r| j         |z   | _         n|dk    r| j        |z   | _         n|| _         t          dt          | 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   r%   s      r   r   zContainerIO.seek8   s€   € ð �1Š9ˆ9Ø”x &Ñ(ˆDŒHˆHØ�QŠYˆYØ”{ VÑ+ˆDŒHˆHàˆDŒHå�q�#˜dœh¨¬Ñ4Ô4Ñ5Ô5ˆŒØŒ�Š�T”[ 4¤8Ñ+Ñ,Ô,Ð,ØŒxˆr   c                ó   — | j         S )ze
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        )r   r   s    r   ÚtellzContainerIO.tellM   s   € ð Œxˆr   c                ó   — dS r"   r   r   s    r   ÚreadablezContainerIO.readableU   r$   r   éÿÿÿÿÚnr   c                óê   — |dk    rt          || j        | j        z
  ¦  «        }n| j        | j        z
  }|dk    r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, zero or negative,
            read until end of region.
        :returns: An 8-bit string.
        r   Úbr   Ú )r*   r   r   r   r%   Úread)r   r0   s     r   r4   zContainerIO.readX   su   € ð ˆqŠ5ˆ5Ý�A�t”{ T¤XÑ-Ñ.Ô.ˆAˆAà”˜dœhÑ&ˆAØ�Š6ˆ6Ø ¤¤Ð-Ð-�3�3°2Ð5Ø”8˜a‘<ˆŒØŒ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    st          |¦  «        |k    rnŒ8|S )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.
        r2   r   r3   ó   
ú
Tr'   )r   r%   r4   Úlen)r   r0   ÚsÚnewline_characterÚcs        r   ÚreadlinezContainerIO.readlinei   s„   € ð  $¤'¤,Ð.Ð.�C�C°BˆØ%(¨D¬G¬LÐ%8Ð%8˜E˜E¸dÐð	Ø—	’	˜!‘”ˆAØð ØØ�A‘ˆAØÐ%Ò%Ð%­¨Q©¬°1ª¨Øð	ð ˆr   ú
int | Noneúlist[AnyStr]c                óŽ   — g }	 |                       ¦   «         }|sn*|                     |¦  «         t          |¦  «        |k    rnŒA|S )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<   Úappendr8   )r   r0   Úlinesr9   s       r   Ú	readlineszContainerIO.readlines|   sS   € ð ˆð	Ø—’‘”ˆAØð ØØ�LŠL˜‰OŒOˆOÝ�5‰zŒz˜QŠˆØð	ð ˆr   c                ó   — dS r   r   r   s    r   ÚwritablezContainerIO.writableŽ   r    r   r2   r   c                ó   — t          ¦   «         ‚©N©ÚNotImplementedError)r   r2   s     r   ÚwritezContainerIO.write‘   ó   € Ý!Ñ#Ô#Ð#r   rA   úIterable[AnyStr]c                ó   — t          ¦   «         ‚rF   rG   )r   rA   s     r   Ú
writelineszContainerIO.writelines”   rJ   r   NÚsizec                ó   — t          ¦   «         ‚rF   rG   )r   rN   s     r   ÚtruncatezContainerIO.truncate—   rJ   r   r   c                ó   — | S rF   r   r   s    r   Ú	__enter__zContainerIO.__enter__š   ó   € Øˆr   ÚargsÚobjectc                ó.   — |                       ¦   «          d S rF   )Úclose)r   rT   s     r   Ú__exit__zContainerIO.__exit__�   s   € Ø�
Š
‰Œˆˆˆr   c                ó   — | S rF   r   r   s    r   Ú__iter__zContainerIO.__iter__    rS   r   c                óT   — |                       ¦   «         }|sd}t          |¦  «        ‚|S )Nzend of region)r<   ÚStopIteration)r   ÚlineÚmsgs      r   Ú__next__zContainerIO.__next__£   s/   € Ø�}Š}‰ŒˆØð 	%Ø!ˆCÝ Ñ$Ô$Ð$Øˆr   c                ó4   — | j                              ¦   «         S rF   )r   Úfilenor   s    r   ra   zContainerIO.filenoª   s   € ØŒw�~Š~ÑÔÐr   c                ó8   — | j                              ¦   «          d S rF   )r   Úflushr   s    r   rc   zContainerIO.flush­   ó   € ØŒ�Š‰Œˆˆˆr   c                ó8   — | j                              ¦   «          d S rF   )r   rW   r   s    r   rW   zContainerIO.close°   rd   r   )r   r   r   r   r   r   r   r   )r   r   )r   r   r%   r   r   r   )r   r   )r/   )r0   r   r   r   )r0   r=   r   r>   )r2   r   r   r   )rA   rK   r   r   rF   )rN   r=   r   r   )r   r   )rT   rU   r   r   )r   r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r#   ÚioÚSEEK_SETr   r,   r.   r4   r<   rB   rD   rI   rM   rP   rR   rX   rZ   r_   ra   rc   rW   r   r   r   r
   r
      sÎ  € € € € € ðð ð
ð ð ð ð"ð ð ð ðð ð ð ð -/¬Kð ð ð ð ð ð*ð ð ð ðð ð ð ðð ð ð ð ð"ð ð ð ð ð&ð ð ð ð ð$ð ð ð ð$ð $ð $ð $ð$ð $ð $ð $ð$ð $ð $ð $ð $ðð ð ð ðð ð ð ðð ð ð ðð ð ð ð ð  ð  ð  ðð ð ð ðð ð ð ð ð r   r
   )Ú
__future__r   rj   Útypingr   r   ÚTYPE_CHECKINGÚcollections.abcr   r   r   r
   r   r   r   ú<module>rp      s³   ðð  #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø Ð Ð Ð Ð Ð Ð Ð à€Øð &Ø(Ð(Ð(Ð(Ð(Ð(Ø%Ð%Ð%Ð%Ð%Ð%Ð%Ð%ðVð Vð Vð Vð V�"�V”*ñ Vô Vð Vð Vð Vr   