3
`¢JZØ  ã               @   s   G d d„ de ƒZdS )c               @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚIteratora-  
    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   s"   t |dƒstdƒ‚|| _d| _d S )NÚseekzim must have seek methodé    )ÚhasattrÚAttributeErrorÚimÚposition)Úselfr   © r	   ú3/usr/lib/python3/dist-packages/PIL/ImageSequence.pyÚ__init__   s    
zIterator.__init__c             C   s0   y| j j|ƒ | j S  tk
r*   t‚Y nX d S )N)r   r   ÚEOFErrorÚ
IndexError)r   Zixr	   r	   r
   Ú__getitem__%   s
    zIterator.__getitem__c             C   s   | S )Nr	   )r   r	   r	   r
   Ú__iter__,   s    zIterator.__iter__c             C   s@   y"| j j| jƒ |  jd7  _| j S  tk
r:   t‚Y nX d S )Né   )r   r   r   r   ÚStopIteration)r   r	   r	   r
   Ú__next__/   s    zIterator.__next__c             C   s   | j ƒ S )N)r   )r   r	   r	   r
   Únext7   s    zIterator.nextN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r	   r	   r	   r
   r      s   
r   N)Úobjectr   r	   r	   r	   r
   Ú<module>   s    