o
    i                     @   sh   d Z ddlZddlmZmZ ddlmZmZ ddl	m
Z
mZmZmZmZ ddlmZ G dd deZdS )	z?Manager to read and modify frontend config data in JSON files.
    N)BaseJSONConfigManagerrecursive_update)jupyter_config_dirjupyter_config_path)UnicodeInstanceListobservedefault)LoggingConfigurablec                   @   s   e Zd ZdZdd Zdd Zdd Zee Z	e
dd	d
 Ze Ze
ddd ZeeZe
ddd Zeddd ZdS )ConfigManagerz8Config Manager used for storing notebook frontend configc                 C   s8   i }| j ddd D ]}t|d}t||| q
|S )z(Get the config from all config sections.N
config_dir)read_config_pathr   r   get)selfsection_nameconfigpcm r   [/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/notebook/services/config/manager.pyr      s
   
zConfigManager.getc                 C      | j ||S )z)Set the config only to the user's config.)write_config_managerset)r   r   datar   r   r   r         zConfigManager.setc                 C   r   )z,Update the config only to the user's config.)r   update)r   r   new_datar   r   r   r       r   zConfigManager.updater   c                 C   s   dd t  D S )Nc                 S   s   g | ]	}t j|d qS )nbconfig)ospathjoin).0r   r   r   r   
<listcomp>*   s    z;ConfigManager._default_read_config_path.<locals>.<listcomp>)r   r   r   r   r   _default_read_config_path(      z'ConfigManager._default_read_config_pathwrite_config_dirc                 C   s   t jt dS )Nr    )r!   r"   r#   r   r&   r   r   r   _default_write_config_dir.   r(   z'ConfigManager._default_write_config_dirr   c                 C   s   t | jdS Nr   )r   r)   r&   r   r   r   _default_write_config_manager4   s   z+ConfigManager._default_write_config_managerc                 C   s   t | jd| _d S r+   )r   r)   r   )r   changer   r   r   _update_write_config_dir8   s   z&ConfigManager._update_write_config_dirN)__name__
__module____qualname____doc__r   r   r   r   r   r   r
   r'   r)   r*   r   r   r   r,   r	   r.   r   r   r   r   r      s     	



r   )r2   os.pathr!   notebook.config_managerr   r   jupyter_core.pathsr   r   	traitletsr   r   r   r	   r
   traitlets.configr   r   r   r   r   r   <module>   s    