ó
N'—^c           @  su  d  d l  m Z d  d l m Z d  d l Z d  d l Z d e f d „  ƒ  YZ d Z e j	 d d !d	 g k r€ d Z e j	 d =n  e j	 d se
 ƒ  e
 d
 ƒ e
 ƒ  e
 d ƒ e
 d ƒ e
 d ƒ e
 d ƒ e
 ƒ  e
 d ƒ e
 d ƒ e
 d ƒ e j d ƒ n  e j	 d Z e j	 d Z e d j e j	 d ƒ ƒ Z y e d Wn7 e k
 r}e j j e ƒ \ Z Z e d e Z n Xd Z e j e ƒ Z e rÔe j j e ƒ \ Z Z e e d d ƒ Z e j d ƒ n  x„ e rZe e r'e j e e ƒ e
 e e ƒ e r'e j d e e ƒ q'n  y e j e ƒ Wn e k
 rLPn Xe d 7Z q×We rqe j d ƒ n  d S(   iÿÿÿÿ(   t   print_function(   t   ImageNt   Intervalc           B  s&   e  Z d  d „ Z d „  Z d „  Z RS(   t   0c         C  s   |  j  | ƒ d  S(   N(   t   setinterval(   t   selft   interval(    (    sC   /tmp/pip-unpacked-wheel-ivxKtu/Pillow-3.4.2.data/scripts/explode.pyt   __init__   s    c         C  sï   g  |  _  x¾ | j d ƒ D]­ } | j ƒ  s1 q n  y7 t | ƒ } | d k  r] d | } } n
 | } } WnE t k
 r¯ | j d ƒ } t | |  ƒ t | | d ƒ } } n X|  j  j | | f ƒ q W|  j  së t j d f g |  _  n  d  S(   Nt   ,i    t   -i   (	   t   hilot   splitt   stript   intt
   ValueErrort   findt   appendt   syst   maxsize(   R   R   t   st   vt   lot   hit   i(    (    sC   /tmp/pip-unpacked-wheel-ivxKtu/Pillow-3.4.2.data/scripts/explode.pyR      s    	)	c         C  s>   x7 |  j  D], \ } } | | k o- | k n r
 d Sq
 Wd S(   Ni   i    (   R
   (   R   t   indexR   R   (    (    sC   /tmp/pip-unpacked-wheel-ivxKtu/Pillow-3.4.2.data/scripts/explode.pyt   __getitem__,   s    (   t   __name__t
   __module__R   R   R   (    (    (    sC   /tmp/pip-unpacked-wheel-ivxKtu/Pillow-3.4.2.data/scripts/explode.pyR      s   	i    i   i   s   -hs1   Syntax: python explode.py infile template [range]s;   The template argument is used to construct the names of thes=   individual frame files.  The frames are numbered file001.ext,s=   file002.ext, etc.  You can insert %d to control the placements   and syntax of the frame number.s>   The optional range argument specifies which frames to extract.s:   You can give one or more ranges like 1-10, 5, -15 etc.  Ifs"   omitted, all frames are extracted.R   i   s   %03ds   .htmlt   ws   <html>
<body>
s   <img src='%s'><br>
s   </body>
</html>
(   t
   __future__R    t   PILR   t   osR   t   objectR   t   htmlt   argvt   printt   exitt   infilet   outfilet   joint   framest	   TypeErrort   patht   splitextt   filet   extt   ixt   opent   imt   writet   Truet   savet   seekt   EOFError(    (    (    sC   /tmp/pip-unpacked-wheel-ivxKtu/Pillow-3.4.2.data/scripts/explode.pyt   <module>	   s`   &







	
