3 }úÿ\ª ã@sddlZGdd„deƒZdS)éNc@sLeZdZdd„Zdd„Zejfdd„Zdd„Zdd d „Z d d „Z dd„Z dS)Ú ContainerIOcCs(||_d|_||_||_|jj|ƒ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 úg/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-install-i584jbuk/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ƒƒ|_|jj|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 ÚtellAszContainerIO.tellrcCsD|rt||j|jƒ}n |j|j}|s,dS|j||_|jj|ƒ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 rIs  zContainerIO.readcCs0d}x&|jdƒ}|sP||}|dkrPqW|S)zJ Read a line of text. :returns: An 8-bit string. rrÚ )r)rÚsÚcr r r ÚreadlineZs zContainerIO.readlinecCs&g}x|jƒ}|sP|j|ƒqW|S)zZ Read multiple lines of text. :returns: A list of 8-bit strings. )rÚappend)rÚlinesrr r r Ú readlinesjszContainerIO.readlinesN)r) Ú__name__Ú __module__Ú __qualname__r r ÚioÚSEEK_SETrrrrrr r r r rs r)r!Úobjectrr r r r Ús