B ë˜Þ]© ã@sddlZGdd„deƒZdS)éNc@sLeZdZdd„Zdd„Zejfdd„Zdd„Zdd d „Z d d „Z dd„Z dS)Ú ContainerIOcCs(||_d|_||_||_|j |¡dS)z­ Create file object. :param file: Existing file. :param offset: Start of region, in bytes. :param length: Size of region, in bytes. rN)ÚfhÚposÚoffsetÚlengthÚseek)ÚselfÚfilerr©r ú1/tmp/pip-build-ktz6qwqq/Pillow/PIL/ContainerIO.pyÚ__init__s zContainerIO.__init__cCsdS)NFr )rr r r Úisatty*szContainerIO.isattycCs`|dkr|j||_n|dkr,|j||_n||_tdt|j|jƒƒ|_|j |j|j¡dS)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. éérN)rrÚmaxÚminrrr)rrÚmoder r r r-s zContainerIO.seekcCs|jS)ze Get current file pointer. :returns: Offset from start of region, in bytes. )r)rr r r Útell@szContainerIO.tellrcCsD|rt||j|jƒ}n |j|j}|s,dS|j||_|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. Ú)rrrrÚread)rÚnr r r rHs  zContainerIO.readcCs0d}x&| d¡}|sP||}|dkrPqW|S)zJ Read a line of text. :returns: An 8-bit string. rrÚ )r)rÚsÚcr r r ÚreadlineYs zContainerIO.readlinecCs&g}x| ¡}|sP| |¡qW|S)zZ Read multiple lines of text. :returns: A list of 8-bit strings. )rÚappend)rÚlinesrr r r Ú readlinesiszContainerIO.readlinesN)r) Ú__name__Ú __module__Ú __qualname__r r ÚioÚSEEK_SETrrrrrr r r r rs r)r!Úobjectrr r r r Ús