
    f                     6    d Z ddlmZ ddlmZ  G d de      Zy)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                        e Zd ZdZ ed      j                  d      Z ed      j                  d      Z fdZd Z	d	 Z
 x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                 $    t        |   di | y)z$
        Public constructor
        N )super__init__)selfkw	__class__s     a/var/www/cvtools/html/venv/lib/python3.12/site-packages/nbconvert/preprocessors/convertfigures.pyr   z#ConvertFiguresPreprocessor.__init__   s     	2    c                     t               )zConvert the figure.)NotImplementedError)r   data_formatdatas      r   convert_figurez)ConvertFiguresPreprocessor.convert_figure   s    !##r   c                 N   |j                  dg       D ]  }|j                  dv s| j                  |j                  v s+| j                  |j                  vsD| j                  | j                  |j                  | j                           |j                  | j                  <    ||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	resources
cell_indexoutputs        r   preprocess_cellz*ConvertFiguresPreprocessor.preprocess_cell    s     hhy"- 	F""&HH$$3NN&++5.2.A.A$$fkk$2B2B&C/DNN+	 Yr   )__name__
__module____qualname____doc__r   tagr   r   r   r   r$   __classcell__)r   s   @r   r   r      sK     =>BB$BOK:;??t?LI$r   r   N)r(   	traitletsr   baser   r   r   r   r   <module>r-      s     $ $r   