B
    KZ                 @   s0   d Z ddlmZ ddlmZ G dd deZdS )zdModule containing a preprocessor that converts outputs in the notebook from 
one format to another.
   )Preprocessor    )Unicodec                   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)ZconfigzFormat the converter writesc                s   t t| jf | dS )z$
        Public constructor
        N)superr   __init__)selfkw)	__class__ Elib/python3.7/site-packages/nbconvert/preprocessors/convertfigures.pyr      s    z#ConvertFiguresPreprocessor.__init__c             C   s
   t  d S )N)NotImplementedError)r	   Zdata_formatdatar   r   r   convert_figure   s    z)ConvertFiguresPreprocessor.convert_figurec             C   s^   xT| dg D ]D}|jdkr| j|jkr| j|jkr| | j|j| j |j| j< qW ||fS )zS
        Apply a transformation on each cell,
        
        See base.py
        Zoutputs>   execute_resultdisplay_data)getZoutput_typefrom_formatr   	to_formatr   )r	   ZcellZ	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   baser   Z	traitletsr   r   r   r   r   r   <module>   s   