a
    ø£Beš  ã                   @   sN   d Z ddlmZmZ ddlmZ ddlmZ dZG dd„ deƒZ	de	fgZ
d	S )
z.HTTP handler to shut down the Jupyter server.
é    )ÚioloopÚweb)Ú
authorized)ÚJupyterHandlerÚserverc                   @   s&   e Zd ZdZeZejedd„ ƒƒZ	dS )ÚShutdownHandlerzA shutdown API handler.c                 Ã   s4   | j  d¡ | jr"| j ¡ I dH  tj ¡  ¡  dS )zShut down the server.z'Shutting down on /api/shutdown request.N)ÚlogÚinfoZ	serverappÚ_cleanupr   ZIOLoopÚcurrentÚstop)Úself© r   úc/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/jupyter_server/services/shutdown.pyÚpost   s    zShutdownHandler.postN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚAUTH_RESOURCEZauth_resourcer   Úauthenticatedr   r   r   r   r   r   r      s
   r   z/api/shutdownN)r   Útornador   r   Zjupyter_server.authr   Zjupyter_server.base.handlersr   r   r   Zdefault_handlersr   r   r   r   Ú<module>   s   ÿ