o
    ¹i  ã                   @   sL   d Z ddlZddlmZ ddlmZ G dd„ deƒZdZd	e› efgZdS )
z-Tornado handlers for frontend config storage.é    N)Úwebé   )Ú
APIHandlerc                   @   s6   e Zd Zejdd„ ƒZejdd„ ƒZejdd„ ƒZdS )ÚConfigHandlerc                 C   s(   |   dd¡ |  t | j |¡¡¡ d S )NzContent-Typezapplication/json)Ú
set_headerÚfinishÚjsonÚdumpsÚconfig_managerÚget)ÚselfÚsection_name© r   ú\/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/notebook/services/config/handlers.pyr      s   zConfigHandler.getc                 C   s$   |   ¡ }| j ||¡ |  d¡ d S )NéÌ   )Úget_json_bodyr
   ÚsetÚ
set_status)r   r   Údatar   r   r   Úput   s   zConfigHandler.putc                 C   s*   |   ¡ }| j ||¡}|  t |¡¡ d S )N)r   r
   Úupdater   r   r	   )r   r   Únew_dataÚsectionr   r   r   Úpatch   s   zConfigHandler.patchN)Ú__name__Ú
__module__Ú__qualname__r   Úauthenticatedr   r   r   r   r   r   r   r   
   s    

r   z(?P<section_name>\w+)z/api/config/)	Ú__doc__r   Útornador   Úbase.handlersr   r   Úsection_name_regexÚdefault_handlersr   r   r   r   Ú<module>   s    ÿ