ó
Č4ec           @   s   d  d l  m Z d  d l m Z d  d l m Z d Z d Z d   Z	 d e f d     YZ
 e j e
 j e
 e	  e j e
 j d	  d
 S(   i   (   t   Image(   t   i32le(   t   PcxImageFiles   0.2iąhÞ:c         C   s"   t  |   d k o! t |   t k S(   Ni   (   t   lent   i32t   MAGIC(   t   prefix(    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   _accept#   s    t   DcxImageFilec           B   s\   e  Z d  Z d Z e Z d   Z e d    Z e d    Z	 d   Z
 d   Z d   Z RS(   t   DCXs	   Intel DCXc         C   sŦ   |  j  j d  } t |  t k r3 t d   n  g  |  _ xF t d  D]8 } t |  j  j d   } | sq Pn  |  j j |  qI W|  j  |  _ d  |  _
 |  j d  d  S(   Ni   s   not a DCX filei   i    (   t   fpt   readR   R   t   SyntaxErrort   _offsett   ranget   appendt   _DcxImageFile__fpt   Nonet   framet   seek(   t   selft   st   it   offset(    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   _open1   s    		c         C   s   t  |  j  S(   N(   R   R   (   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   n_framesD   s    c         C   s   t  |  j  d k S(   Ni   (   R   R   (   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   is_animatedH   s    c         C   sP   |  j  |  s d  S| |  _ |  j |  _ |  j j |  j |  t j |   d  S(   N(   t   _seek_checkR   R   R
   R   R   R   R   (   R   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyR   L   s    	c         C   s   |  j  S(   N(   R   (   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   tellT   s    c         C   sO   z> y& |  j  |  j k r( |  j  j   n  Wn t k
 r< n XWd  d  |  _  Xd  S(   N(   R   R
   t   closet   AttributeErrorR   (   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt
   _close__fpW   s     (   t   __name__t
   __module__t   formatt   format_descriptiont   Falset!   _close_exclusive_fp_after_loadingR   t   propertyR   R   R   R   R   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyR   +   s   			s   .dcxN(   t    R    t   _binaryR   R   t   PcxImagePluginR   t   __version__R   R   R   t   register_openR"   t   register_extension(    (    (    s<   /usr/local/lib/python2.7/dist-packages/PIL/DcxImagePlugin.pyt   <module>   s   	6