ó
È4ec           @   s–   d  d l  m Z m Z d	 a d „  Z d „  Z d e j f d „  ƒ  YZ d „  Z	 e j
 e j e e ƒ e j e j e	 ƒ e j e j d d g ƒ d	 S(
   i   (   t   Imaget	   ImageFilec         C   s
   |  a  d S(   s_   
    Install application-specific HDF5 image handler.

    :param handler: Handler object.
    N(   t   _handler(   t   handler(    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyt   register_handler   s    c         C   s   |  d  d k S(   Ni   s   ‰HDF

(    (   t   prefix(    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyt   _accept   s    t   HDF5StubImageFilec           B   s&   e  Z d  Z d  Z d „  Z d „  Z RS(   t   HDF5c         C   s~   |  j  j ƒ  } t |  j  j d ƒ ƒ s6 t d ƒ ‚ n  |  j  j | ƒ d |  _ d |  _ |  j ƒ  } | rz | j	 |  ƒ n  d  S(   Ni   s   Not an HDF filet   Fi   (   i   i   (
   t   fpt   tellR   t   readt   SyntaxErrort   seekt   modet   _sizet   _loadt   open(   t   selft   offsett   loader(    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyt   _open(   s    		c         C   s   t  S(   N(   R   (   R   (    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyR   9   s    (   t   __name__t
   __module__t   formatt   format_descriptionR   R   (    (    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyR   #   s   	c         C   sB   t  d  k s t d d ƒ r+ t d ƒ ‚ n  t  j |  | | ƒ d  S(   NR   t   saves   HDF5 save handler not installed(   R   t   Nonet   hasattrt   IOErrorR   (   t   imR
   t   filename(    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyt   _save=   s    s   .h5s   .hdfN(   t    R    R   R   R   R   R   t   StubImageFileR   R!   t   register_openR   t   register_savet   register_extensions(    (    (    sA   /usr/local/lib/python2.7/dist-packages/PIL/Hdf5StubImagePlugin.pyt   <module>   s   				