§
    ‹Ÿj¦	  ã                  óv   — d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ dd„Z G d„ de	¦  «        ZdS )z6Manager to read and modify config data in JSON files.
é    )ÚannotationsN)ÚAny)ÚLoggingConfigurable)ÚUnicodeÚtargetúdict[Any, Any]ÚnewÚreturnÚNonec                óö   — |                      ¦   «         D ]c\  }}t          |t          ¦  «        r+|| vri | |<   t          | |         |¦  «         | |         s| |= ŒE|€|                      |d¦  «         Œ^|| |<   ŒddS )z^Recursively update one dictionary using another.

    None values will delete their keys.
    N)ÚitemsÚ
isinstanceÚdictÚrecursive_updateÚpop)r   r	   ÚkÚvs       úe/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/traitlets/config/manager.pyr   r      sž   € ð
 —	’	‘”ð ð ‰ˆˆ1Ý�a�ÑÔð 	Ø˜ˆˆØ��q‘	Ý˜V AœY¨Ñ*Ô*Ð*Ø˜!”9ð à˜1�IøàˆYØ�JŠJ�q˜$ÑÔÐÐð ˆF�1‰IˆIðð ó    c                  óP   — e Zd ZdZ ed¦  «        Zdd„Zdd„Zdd
„Zdd„Z	dd„Z
dS )ÚBaseJSONConfigManagerzYGeneral JSON config manager

    Deals with persisting/storing config in a json file
    ú.r
   r   c                ó˜   — 	 t          j        | j        d¦  «         d S # t          $ r!}|j        t          j        k    r‚ Y d }~d S d }~ww xY w)Nií  )ÚosÚmakedirsÚ
config_dirÚOSErrorÚerrnoÚEEXIST)ÚselfÚes     r   Úensure_config_dir_existsz.BaseJSONConfigManager.ensure_config_dir_exists-   sf   € ð	ÝŒK˜œ¨Ñ/Ô/Ð/Ð/Ð/øÝð 	ð 	ð 	ØŒw�%œ,Ò&Ð&Øð 'Ð&Ð&Ð&Ð&Ð&øøøøð	øøøs   ‚ ž
A	¨AÁA	Úsection_nameÚstrc                óR   — t           j                             | j        |dz   ¦  «        S )Nz.json)r   ÚpathÚjoinr   )r    r#   s     r   Ú	file_namezBaseJSONConfigManager.file_name4   s   € ÝŒw�|Š|˜DœO¨\¸GÑ-CÑDÔDÐDr   r   c                óì   — |                       |¦  «        }t          j                             |¦  «        r?t	          |d¬¦  «        5 }t          j        |¦  «        cddd¦  «         S # 1 swxY w Y   dS i S )z¡Retrieve the config data for the specified section.

        Returns the data as a dictionary, or an empty dictionary if the file
        doesn't exist.
        úutf-8©ÚencodingN)r(   r   r&   ÚisfileÚopenÚjsonÚload)r    r#   ÚfilenameÚfs       r   ÚgetzBaseJSONConfigManager.get7   s±   € ð —>’> ,Ñ/Ô/ˆÝŒ7�>Š>˜(Ñ#Ô#ð 	Ý�h¨Ð1Ñ1Ô1ð $°QÝ”y ‘|”|ð$ð $ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $ð $ð $ð ˆIs   ÁA'Á'A+Á.A+Údatac                óÜ   — |                       |¦  «        }|                      ¦   «          t          |dd¬¦  «        5 }t          j        ||d¬¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zStore the given config data.Úwr*   r+   é   )ÚindentN)r(   r"   r.   r/   Údump)r    r#   r4   r1   r2   s        r   ÚsetzBaseJSONConfigManager.setD   s²   € à—>’> ,Ñ/Ô/ˆØ×%Ò%Ñ'Ô'Ð'å�(˜C¨'Ð2Ñ2Ô2ð 	)°aÝŒI�d˜A aÐ(Ñ(Ô(Ð(ð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð 	)ð 	)s   ¼A!Á!A%Á(A%Únew_datac                ó|   — |                       |¦  «        }t          ||¦  «         |                      ||¦  «         |S )z‡Modify the config section by recursively updating it with new_data.

        Returns the modified config data as a dictionary.
        )r3   r   r:   )r    r#   r;   r4   s       r   ÚupdatezBaseJSONConfigManager.updateL   s>   € ð
 �xŠx˜Ñ%Ô%ˆÝ˜˜xÑ(Ô(Ð(Ø�Š�˜tÑ$Ô$Ð$Øˆr   N)r
   r   )r#   r$   r
   r$   )r#   r$   r
   r   )r#   r$   r4   r   r
   r   )r#   r$   r;   r   r
   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r"   r(   r3   r:   r=   © r   r   r   r   %   s•   € € € € € ðð ð
 �˜‘”€Jðð ð ð ðEð Eð Eð Eðð ð ð ð)ð )ð )ð )ðð ð ð ð ð r   r   )r   r   r	   r   r
   r   )rA   Ú
__future__r   r   r/   r   Útypingr   Útraitlets.configr   Útraitlets.traitletsr   r   r   rB   r   r   ú<module>rG      s½   ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð*/ð /ð /ð /ð /Ð/ñ /ô /ð /ð /ð /r   