î
úÙ X¤
  ã               @   s   Gd  d „  d e  ƒ Z d S)c               @   sj   e  Z d  Z d d „  Z d d „  Z d d d „ Z d d	 „  Z d d
 d „ Z d d „  Z d d „  Z	 d S)ÚContainerIOc             C   s8   | |  _  d |  _ | |  _ | |  _ |  j  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.
        é    N)ÚfhÚposÚoffsetÚlengthÚseek)ÚselfÚfiler   r   © r
   úL/home/ubuntu/projects/ifolica/lib/python3.4/site-packages/PIL/ContainerIO.pyÚ__init__   s
    				zContainerIO.__init__c             C   s   d S)Nr   r
   )r   r
   r
   r   Úisatty)   s    zContainerIO.isattyr   c             C   s†   | d k r |  j  | |  _  n( | d k r> |  j | |  _  n	 | |  _  t d t |  j  |  j ƒ ƒ |  _  |  j j |  j |  j  ƒ d S)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.
        é   é   r   N)r   r   ÚmaxÚminr   r   r   )r   r   Úmoder
   r
   r   r   ,   s    		!zContainerIO.seekc             C   s   |  j  S)ze
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        )r   )r   r
   r
   r   Útell?   s    zContainerIO.tellc             C   s\   | r" t  | |  j |  j ƒ } n |  j |  j } | s< d S|  j | |  _ |  j j | ƒ S)zÄ
        Read data.

        @def read(bytes=0)
        :param bytes: Number of bytes to read. If omitted or zero,
            read until end of region.
        :returns: An 8-bit string.
        Ú )r   r   r   r   Úread)r   Únr
   r
   r   r   G   s    	zContainerIO.readc             C   sD   d } x7 |  j  d ƒ } | s" Pn  | | } | d k r	 Pq	 q	 W| S)zJ
        Read a line of text.

        :returns: An 8-bit string.
        r   r   Ú
)r   )r   ÚsÚcr
   r
   r   ÚreadlineY   s    
zContainerIO.readlinec             C   s4   g  } x' |  j  ƒ  } | s Pn  | j | ƒ q	 W| S)zZ
        Read multiple lines of text.

        :returns: A list of 8-bit strings.
        )r   Úappend)r   Úlr   r
   r
   r   Ú	readlinesi   s    zContainerIO.readlinesN)
Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r
   r
   r
   r   r      s   r   N)Úobjectr   r
   r
   r
   r   Ú<module>   s    