B
    7d                 @   s|   d Z ddlmZmZ ddlmZmZ ddlmZm	Z	 ddl
mZmZ ddlmZ G dd deeeZd	e eefgZd
S )z+Tornado handlers for the terminal emulator.    )webgen)JupyterHandler
path_regex)
url_escapeensure_async)ExtensionHandlerMixinExtensionHandlerJinjaMixin)nbclassic_pathc               @   s$   e Zd ZdZejejdd ZdS )EditorHandlerz!Render the text editor interface.c             c   sd   | d}t| j|V }|s0tdd| |ddd }| | jdt	|||d d d S )	N/i  zFile does not exist: %s   z	edit.htmlz
 (editing))	file_pathbasenameZ
page_title)
stripr   Zcontents_managerZfile_existsr   	HTTPErrorrsplitwriteZrender_templater   )selfpathexistsr    r   d/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/nbclassic/edit/handlers.pyget   s    

zEditorHandler.getN)	__name__
__module____qualname____doc__r   authenticatedr   	coroutiner   r   r   r   r   r      s   r   z	{}/edit{}N)r   tornador   r   Zjupyter_server.base.handlersr   r   Zjupyter_server.utilsr   r   Z jupyter_server.extension.handlerr   r	   Z	nbclassicr
   r   formatZdefault_handlersr   r   r   r   <module>   s   