ó
§]c           @   s@   d  Z  d d l m Z d d l m Z d e f d     YZ d S(   sd   Module containing a preprocessor that converts outputs in the notebook from 
one format to another.
i   (   t   Preprocessori˙˙˙˙(   t   Unicodet   ConvertFiguresPreprocessorc           B   s_   e  Z d  Z e d d  j d e  Z e d d  j d e  Z d   Z d   Z	 d   Z
 RS(   sO   
    Converts all of the outputs in a notebook from one format to another.
    t   helps   Format the converter acceptst   configs   Format the converter writesc         K   s   t  t |   j |   d S(   s$   
        Public constructor
        N(   t   superR   t   __init__(   t   selft   kw(    (    sE   lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.pyR      s    c         C   s   t     d  S(   N(   t   NotImplementedError(   R   t   data_formatt   data(    (    sE   lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.pyt   convert_figure   s    c         C   s   x | j  d g   D]k } | j d d h k r |  j | j k r |  j | j k r |  j |  j | j |  j  | j |  j <q q W| | f S(   sS   
        Apply a transformation on each cell,
        
        See base.py
        t   outputst   execute_resultt   display_data(   t   gett   output_typet   from_formatR   t	   to_formatR   (   R   t   cellt	   resourcest
   cell_indext   output(    (    sE   lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.pyt   preprocess_cell    s    *(   t   __name__t
   __module__t   __doc__R   t   tagt   TrueR   R   R   R   R   (    (    (    sE   lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.pyR      s   		N(   R   t   baseR    t	   traitletsR   R   (    (    (    sE   lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.pyt   <module>   s   