ó
È4ec           @   s&   d  d l  Z  d e f d „  ƒ  YZ d S(   iÿÿÿÿNt   ContainerIOc           B   sP   e  Z d  „  Z d „  Z e j d „ Z d „  Z d d „ Z d „  Z	 d „  Z
 RS(   c         C   s8   | |  _  d |  _ | |  _ | |  _ |  j  j | ƒ d S(   s­   
        Create file object.

        :param file: Existing file.
        :param offset: Start of region, in bytes.
        :param length: Size of region, in bytes.
        i    N(   t   fht   post   offsett   lengtht   seek(   t   selft   fileR   R   (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt   __init__   s
    				c         C   s   t  S(   N(   t   False(   R   (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt   isatty*   s    c         C   s†   | d k r |  j  | |  _  n( | d k r> |  j | |  _  n	 | |  _  t d t |  j  |  j ƒ ƒ |  _  |  j j |  j |  j  ƒ d S(   s  
        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.
        i   i   i    N(   R   R   t   maxt   minR   R   R   (   R   R   t   mode(    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyR   -   s    		!c         C   s   |  j  S(   se   
        Get current file pointer.

        :returns: Offset from start of region, in bytes.
        (   R   (   R   (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt   tell@   s    i    c         C   s\   | r" t  | |  j |  j ƒ } n |  j |  j } | s< d S|  j | |  _ |  j j | ƒ S(   s¥   
        Read data.

        :param n: Number of bytes to read. If omitted or zero,
            read until end of region.
        :returns: An 8-bit string.
        t    (   R   R   R   R   t   read(   R   t   n(    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyR   H   s    c         C   sJ   d } x= t  rE |  j d ƒ } | s( Pn  | | } | d k r	 Pq	 q	 W| S(   sJ   
        Read a line of text.

        :returns: An 8-bit string.
        R   i   s   
(   t   TrueR   (   R   t   st   c(    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt   readlineY   s    	
c         C   s:   g  } x- t  r5 |  j ƒ  } | s% Pn  | j | ƒ q	 W| S(   sZ   
        Read multiple lines of text.

        :returns: A list of 8-bit strings.
        (   R   R   t   append(   R   t   linesR   (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt	   readlinesi   s    	(   t   __name__t
   __module__R   R
   t   iot   SEEK_SETR   R   R   R   R   (    (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyR       s   				(   R   t   objectR    (    (    (    s9   /usr/local/lib/python2.7/dist-packages/PIL/ContainerIO.pyt   <module>   s   