CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
ContainerIO.cpython-310.pyc79 linesDownload Raw Back to __pycache__
1o

2��Yi��@sLddlmZddlZddlmZddlmZmZmZGdd�dee�Z	dS)�)�annotationsN)�Iterable)�IO�AnyStr�NoReturnc@s�eZdZdZdAd	d3�ZdBdd
�ZdBdd�ZejfdCdd�Z	dDdd�Z4dBdd�ZdEdFdd�ZdEdFdd�Z
dEdGd d!�ZdBd"d#�ZdHd&d'�ZdId*d+�ZdJdKd.d/�ZdLd1d2�ZdMd5d6�ZdLd7d8�ZdNd9d:�ZdDd;d<�ZdOd=d>�ZdOd?d@�Zd,S)P�ContainerIOzm5    A file object that provides read access to a part of an existing6    file (for example a TAR file).7    �file�8IO[AnyStr]�offset�int�length�return�NonecCs(||_d|_||_||_|j�|�dS)z�9        Create file object.10 11        :param file: Existing file.12        :param offset: Start of region, in bytes.13        :param length: Size of region, in bytes.14        rN)�fh�posr15r�seek)�selfrr16r�r�yE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/ContainerIO.py�__init__s17zContainerIO.__init__�boolcC�dS�NFr�rrrr�isatty.�zContainerIO.isattycCr�NTrrrrr�seekable1rzContainerIO.seekable�modecCsb|dkr|j||_n|dkr|j||_n||_tdt|j|j��|_|j�|j|j�|jS)aK18        Move file pointer.19 20        :param offset: Offset in bytes.21        :param mode: Starting position. Use 0 for beginning of region, 122           for current offset, and 2 for end of region.  You cannot move23           the pointer outside the defined region.24        :returns: Offset from start of region, in bytes.25        ��r)rr�max�minrrr26)rr27rrrrr4s28zContainerIO.seekcCs|jS)ze29        Get current file pointer.30 31        :returns: Offset from start of region, in bytes.32        )rrrrr�tellIszContainerIO.tellcCrrrrrrr�readableQrzContainerIO.readable������nrcCs\|dkrt||j|j�}n|j|j}|dkr"d|jjvr dSdS|j||_|j�|�S)z�33        Read data.34 35        :param n: Number of bytes to read. If omitted, zero or negative,36            read until end of region.37        :returns: An 8-bit string.38        r�b��)r"rrrr�read)rr&rrrr*TszContainerIO.readcCsbd|jjvrdnd}d|jjvrdnd}	|�d�}|s	|S||}||ks-t|�|kr0	|Sq)z�39        Read a line of text.40 41        :param n: Number of bytes to read. If omitted, zero or negative,42            read until end of line.43        :returns: An 8-bit string.44        r'r(r)�45�46Tr)rrr*�len)rr&�sZnewline_character�crrr�readlinees47��zContainerIO.readline�48int | None�list[AnyStr]cCs6g}	|��}|s	|S|�|�t|�|kr	|Sq)z�49        Read multiple lines of text.50 51        :param n: Number of lines to read. If omitted, zero, negative or None,52            read until end of region.53        :returns: A list of 8-bit strings.54        )r0�appendr-)rr&�linesr.rrr�	readlinesxs55��zContainerIO.readlinescCrrrrrrr�writable�rzContainerIO.writabler'rcC�t���N��NotImplementedError)rr'rrr�write��zContainerIO.writer4�Iterable[AnyStr]cCr7r8r9)rr4rrr�56writelines�r<zContainerIO.writelinesN�sizecCr7r8r9)rr?rrr�truncate�r<zContainerIO.truncate�ContainerIO[AnyStr]cC�|Sr8rrrrr�	__enter__�rzContainerIO.__enter__�args�objectcGs|��dSr8)�close)rrDrrr�__exit__�szContainerIO.__exit__cCrBr8rrrrr�__iter__�rzContainerIO.__iter__cCs|��}|sd}t|��|S)Nz
end of region)r0�
StopIteration)r�line�msgrrr�__next__�s57zContainerIO.__next__cCs58|j��Sr8)r�filenorrrrrM�s59zContainerIO.filenocC�|j��dSr8)r�flushrrrrrO��zContainerIO.flushcCrNr8)rrFrrrrrF�rPzContainerIO.close)rr	r60rrrr
r)r
r)r61rrrr
r)r
r)r%)r&rr
r)r&r1r
r2)r'rr
r)r4r=r
rr8)r?r1r
r)r
rA)rDrEr
r)r
r)r
r)�__name__�62__module__�__qualname__�__doc__rrr�io�SEEK_SETrr#r$r*r0r5r6r;r>r@rCrGrHrLrMrOrFrrrrrs,6364656667686970717273747576r)7778__future__rrU�collections.abcr�typingrrrrrrrr�<module>s79
Aluode/PerceptionLabPortable · CoolFace