a
    ø£Be�  ã                   @   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 )ÚNotebookExporterzÄExports 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
   ú_/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/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r6d| j |d< nd|d< tj|| jd�}| d¡s`|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   