
    Ib                     n    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e      Zy)	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                       e Zd ZdZd Zd Zd Z e e             Z	 e
d      d        Z e       Z e
d      d        Z ee      Z e
d	      d
        Z ed      d        Zy)ConfigManagerz8Config Manager used for storing notebook frontend configc                     i }| j                   ddd   D ])  }t        |      }t        ||j                  |             + |S )z(Get the config from all config sections.N
config_dir)read_config_pathr   r   get)selfsection_nameconfigpcms        B/usr/lib/python3/dist-packages/notebook/services/config/manager.pyr   zConfigManager.get   sI    &&tt, 	;A&!4BVRVVL%9:	;     c                 :    | j                   j                  ||      S )z)Set the config only to the user's config.)write_config_managerset)r   r   datas      r   r   zConfigManager.set   s    ((,,\4@@r   c                 :    | j                   j                  ||      S )z,Update the config only to the user's config.)r   update)r   r   new_datas      r   r!   zConfigManager.update    s    ((//hGGr   r   c                 x    t               D cg c]"  }t        j                  j                  |d      $ c}S c c}w Nnbconfig)r   ospathjoin)r   r   s     r   _default_read_config_pathz'ConfigManager._default_read_config_path(   s(    5H5JKQ
+KKKs   '7write_config_dirc                 R    t         j                  j                  t               d      S r$   )r&   r'   r(   r   r   s    r   _default_write_config_dirz'ConfigManager._default_write_config_dir.   s    ww||.0*==r   r   c                 .    t        | j                        S Nr   )r   r*   r,   s    r   _default_write_config_managerz+ConfigManager._default_write_config_manager4   s    $0E0EFFr   c                 :    t        | j                        | _        y r/   )r   r*   r   )r   changes     r   _update_write_config_dirz&ConfigManager._update_write_config_dir8   s    $9TEZEZ$[!r   N)__name__
__module____qualname____doc__r   r   r!   r	   r   r   r   r)   r*   r-   r   r   r   r0   r
   r3    r   r   r   r      s    BAH GI L !L y > !> $$9:#$G %G  \ !\r   r   )r7   os.pathr&   notebook.config_managerr   r   jupyter_core.pathsr   r   	traitletsr   r   r	   r
   r   traitlets.configr   r   r8   r   r   <module>r>      s-   
  K F ? ? 0,\' ,\r   