o
    tf                     @   s<   d Z ddlZddlmZmZ ddlmZ G dd deZdS )zNotebookExporter class    N)Enumdefault   )Exporterc                       sX   e Zd ZdZeeejejddj	ddZ
eddd Zd	Zd
Zd fdd	Z  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)configZfile_extensionc                 C   s   dS )Nz.ipynb )selfr
   r
   e/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/nbconvert/exporters/notebook.py_file_extension_default   s   z(NotebookExporter._file_extension_defaultzapplication/jsonZNotebookNc                    sh   t  j||fi |\}}| j|jkrd| j |d< nd|d< tj|| jd}|ds0|d }||fS )zConvert from notebook node.z.v%iZoutput_suffixz
.nbconvert)version
)superfrom_notebook_nodenbformat_versionnbformatZwritesendswith)r   nb	resourceskwZnb_copyoutput	__class__r
   r   r   "   s   
z#NotebookExporter.from_notebook_node)N)__name__
__module____qualname____doc__r   listr   versionsZcurrent_nbformattagr   r   r   Zoutput_mimetypeZexport_from_notebookr   __classcell__r
   r
   r   r   r      s    
r   )r   r   Z	traitletsr   r   Zexporterr   r   r
   r
   r
   r   <module>   s
    