a
    Df                     @   s.   d dl mZ ddlmZ G dd dejZdS )    )web   )_cleanup_docc                   @   s   e Zd Zdd Zdd ZdS )LivenessHandlerc                 C   s
   || _ d S )N)applications)selfr    r   ^/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/panel/io/liveness.py
initialize   s    zLivenessHandler.initializec              
      s   | j dd d}| dd |d urB|| jvrBtdd|dn|d u r`| | jjdi d S | j| }z"| }t	| | |di W n> t
y } z&td	d|d
| |W Y d }~n
d }~0 0 d S )Nendpoint)defaultzContent-Typezapplication/jsoni  z	Endpoint z does not exist.Ti  z0 could not be served. Application raised error: )Zget_argumentZ
set_headerr   r   	HTTPErrorwriterequestpathZcreate_documentr   	Exception)r   r   Zappdocer   r   r	   get   s$    
zLivenessHandler.getN)__name__
__module____qualname__r
   r   r   r   r   r	   r      s   r   N)Ztornador   documentr   ZRequestHandlerr   r   r   r   r	   <module>   s   