U
    nuf                     @   s0   d Z ddlmZ ddlmZ G dd deZdS )zModule containing a preprocessor that converts outputs in the notebook from
one format to another.

Converts all of the outputs in a notebook from one format to another.
    )Unicode   )Preprocessorc                       sT   e Zd ZdZeddjddZeddjddZ fddZd	d
 Z	dd Z
  ZS )ConvertFiguresPreprocessorzO
    Converts all of the outputs in a notebook from one format to another.
    zFormat the converter accepts)helpT)configzFormat the converter writesc                    s   t  jf | dS )z$
        Public constructor
        N)super__init__)selfkw	__class__ J/tmp/pip-unpacked-wheel-nxpdnluh/nbconvert/preprocessors/convertfigures.pyr	      s    z#ConvertFiguresPreprocessor.__init__c                 C   s
   t  dS )zConvert the figure.N)NotImplementedError)r
   Zdata_formatdatar   r   r   convert_figure   s    z)ConvertFiguresPreprocessor.convert_figurec                 C   sZ   | dg D ]D}|jdkr| j|jkr| j|jkr| | j|j| j |j| j< q||fS )zK
        Apply a transformation on each cell,

        See base.py
        outputs>   display_dataexecute_result)getoutput_typefrom_formatr   	to_formatr   )r
   cell	resourcesZ
cell_indexoutputr   r   r   preprocess_cell!   s    

 
z*ConvertFiguresPreprocessor.preprocess_cell)__name__
__module____qualname____doc__r   tagr   r   r	   r   r   __classcell__r   r   r   r   r      s   r   N)r!   Z	traitletsr   baser   r   r   r   r   r   <module>   s   	