
    f                     B    d Z ddlZddlmZmZ ddlmZ  G d de      Zy)zNotebookExporter class    N)Enumdefault   )Exporterc                        e Zd ZdZ e eej                        ej                  d      j                  d      Z
 ed      d        ZdZd	Zd fd
	Z xZS )NotebookExporterzExports to an IPython notebook.

    This is useful when you want to use nbconvert's preprocessors to operate on
    a notebook (e.g. to execute it) and then write it back to a notebook file.
    zPThe nbformat version to write.
        Use this to downgrade notebooks.
        )default_valuehelpT)configfile_extensionc                      y)Nz.ipynb )selfs    W/var/www/cvtools/html/venv/lib/python3.12/site-packages/nbconvert/exporters/notebook.py_file_extension_defaultz(NotebookExporter._file_extension_default   s        zapplication/jsonNotebookc                    t        |   ||fi |\  }}| j                  |j                  k7  rd| j                  z  |d<   nd|d<   t        j                  || j                        }|j                  d      s|dz   }||fS )zConvert from notebook node.z.v%ioutput_suffixz
.nbconvert)version
)superfrom_notebook_nodenbformat_versionnbformatwritesendswith)r   nb	resourceskwnb_copyoutput	__class__s         r   r   z#NotebookExporter.from_notebook_node"   s    "W7ILL  G$4$44)/$2G2G)GIo&)5Io&$2G2GHt$d]Fy  r   )N)__name__
__module____qualname____doc__r   listr   versionscurrent_nbformattagr   r   r   output_mimetypeexport_from_notebookr   __classcell__)r#   s   @r   r   r      sr     X// 
cc    )O%
! 
!r   r   )r'   r   	traitletsr   r   exporterr   r   r   r   r   <module>r1      s    
  #  !x  !r   