U
    õÕ/e›  ã                   @  s~   d Z ddlmZ ddlZe e¡ZddlmZm	Z	m
Z
mZ ddlmZ erVddlmZ dZG d	d
„ d
eƒZdddœdd„ZdS )ze Bokeh Application Handler to look for Bokeh server request callbacks
in a specified Python module.

é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚCallableÚDicté   )ÚHandler)ÚHTTPServerRequest)ÚRequestHandlerc                      sR   e Zd ZU dZded< ddœ‡ fdd„Zdd	d
œdd„Zeddœdd„ƒZ‡  Z	S )r
   z\ Load a script which contains server request handler callbacks.

    .. autoclasstoc::

    z-Callable[[HTTPServerRequest], Dict[str, Any]]Ú_process_requestÚNone)Úreturnc                   s   t ƒ  ¡  t| _d S ©N)ÚsuperÚ__init__Ú_return_emptyr   ©Úself©Ú	__class__© úN/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/application/handlers/request_handler.pyr   ?   s    
zRequestHandler.__init__r	   úDict[str, Any]©Úrequestr   c                 C  s
   |   |¡S )a#   Processes incoming HTTP request returning a dictionary of
        additional data to add to the session_context.

        Args:
            request: HTTP request

        Returns:
            A dictionary of JSON serializable data to be included on
            the session context.
        )r   )r   r   r   r   r   Úprocess_requestE   s    zRequestHandler.process_requestÚboolc                 C  s   dS )NTr   r   r   r   r   Úsafe_to_forkR   s    zRequestHandler.safe_to_fork)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   Úpropertyr   Ú__classcell__r   r   r   r   r
   6   s   
r
   r	   r   r   c                 C  s   i S r   r   )r   r   r   r   r   Z   s    r   )r!   Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogÚtypingr   r   r   r   Úhandlerr   Ztornado.httputilr	   Ú__all__r
   r   r   r   r   r   Ú<module>   s   
$