o
    tf                     @   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di | dS )z$
        Public constructor
        N )super__init__)selfkw	__class__r   o/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/nbconvert/preprocessors/convertfigures.pyr
      s   z#ConvertFiguresPreprocessor.__init__c                 C   s   t  )zConvert the figure.)NotImplementedError)r   Zdata_formatdatar   r   r   convert_figure   s   z)ConvertFiguresPreprocessor.convert_figurec                 C   sZ   | dg D ]"}|jdv r(| j|jv r(| j|jvr(| | j|j| j |j| j< q||fS )zK
        Apply a transformation on each cell,

        See base.py
        Zoutputs>   Zexecute_resultZdisplay_data)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    