ó
O'—^c           @   s   d  e  f d „  ƒ  YZ d S(   t   Iteratorc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s-  
    This class implements an iterator object that can be used to loop
    over an image sequence.

    You can use the ``[]`` operator to access elements by index. This operator
    will raise an :py:exc:`IndexError` if you try to access a nonexistent
    frame.

    :param im: An image object.
    c         C   s4   t  | d ƒ s t d ƒ ‚ n  | |  _ d |  _ d  S(   Nt   seeks   im must have seek methodi    (   t   hasattrt   AttributeErrort   imt   position(   t   selfR   (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   __init__   s    	c         C   s9   y |  j  j | ƒ |  j  SWn t k
 r4 t ‚ n Xd  S(   N(   R   R   t   EOFErrort
   IndexError(   R   t   ix(    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   __getitem__%   s
    c         C   s   |  S(   N(    (   R   (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   __iter__,   s    c         C   sK   y- |  j  j |  j ƒ |  j d 7_ |  j  SWn t k
 rF t ‚ n Xd  S(   Ni   (   R   R   R   R   t   StopIteration(   R   (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   __next__/   s    c         C   s
   |  j  ƒ  S(   N(   R   (   R   (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   next7   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyR       s   
				N(   t   objectR    (    (    (    s3   /tmp/pip-unpacked-wheel-ivxKtu/PIL/ImageSequence.pyt   <module>   t    