Your IP : 3.140.188.195


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/clcommon/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/clcommon/__pycache__/ui_config.cpython-311.pyc

�

\�Dg~��b�ddlZddlZddlmZdZddidddddddddd�	d�ZGd	�d
��ZdS)�N)�Mappingz//usr/share/l.v.e-manager/lvemanager-config.json�showUserInodesUsageFT)	�hideRubyApp�hideLVEUserStat�
hidePythonApp�
hideNodeJsApp�hidePHPextensions�hideDomainsTab�
hidePhpApp�hideXrayApp�hideAccelerateWPApp)�inodeLimits�
uiSettingsc�8�eZdZefd�Zd�Zd�Zd�Zdd�Zd�Z	dS)	�UIConfigc��||_i|_i|_	t|d���5}t	j|��|_|jd|_ddd��dS#1swxYwYdS#t$rt|_YdSttf$r4t|jd<t|_|�
|��YdSwxYw)N�utf-8��encoding�	ui_config)�ui_config_path�file_content�config�open�json�load�IOError�DEFAULT_UI_CONFIG�
ValueError�KeyError�_update_file)�selfr�	json_files   �r/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/ui_config.py�__init__zUIConfig.__init__s%��,���������		.��n�w�7�7�7�
=�9�$(�I�i�$8�$8��!�"�/��<���
=�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=����
=�
=�
=�
=�
=�
=���	,�	,�	,�+�D�K�K�K�K��H�%�	.�	.�	.�->�D��k�*�+�D�K����n�-�-�-�-�-�-�	.���s;�A.�,A!�A.�!A%�%A.�(A%�)A.�.C�AC�
Cc��t|dd���5}tj|j|��ddd��dS#1swxYwYdS)N�wrr)rr�dumpr)r"�	file_path�update_files   r$r!zUIConfig._update_file,s���
�)�S�7�
3�
3�
3�	6�{��I�d�'��5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s
�;�?�?c�n�tjt��}|�||j��|S�N)�copy�deepcopyr�_recursive_assignr)r"�initial_configs  r$�
get_configzUIConfig.get_config0s0����'8�9�9�����~�t�{�;�;�;���c��tj|�����}|�||��t	|jdd���5}t
jd|i|��ddd��dS#1swxYwYdS)Nr'rrr)r-r.r1r/rrrr()r"�
new_configr0r#s    r$�
set_configzUIConfig.set_config5s�����t���'8�'8�9�9�����~�z�:�:�:�
�$�%�s�W�
=�
=�
=�	@���I�{�N�3�Y�?�?�?�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@����	@�	@�	@�	@�	@�	@s�A9�9A=�A=Nc���|���}|�|�|��S|�|���(|�|���|��SdSr,)r1�get)r"�param�parent_paramrs    r$�	get_paramzUIConfig.get_param;s`�����"�"�����:�:�e�$�$�$�
�Z�Z��
%�
%�
1��:�:�l�+�+�/�/��6�6�6��tr2c��|���D]d\}}t|t��r.|�|�|i��|��||<�H|�|�|���|||<�e|S)z�
        Function that recursively assignees values received from the UI
        :param initial_config: Config to which values are assigned
        :param new_config: New config file received from UI
        :return:
        )�items�
isinstancerr/r7)r"r0r4�key�values     r$r/zUIConfig._recursive_assignCs���%�*�*�,�,�	,�	,�J�C���%��)�)�
,�&*�&<�&<�^�=O�=O�PS�UW�=X�=X�Z_�&`�&`��s�#�#��"�~�'9�'9�#�'>�'>�'J�&+��s�#���r2r,)
�__name__�
__module__�__qualname__�UI_CONFIG_FILEr%r!r1r5r:r/�r2r$rrs~������&4�
.�
.�
.�
.�6�6�6����
@�@�@���������r2r)rr-�collections.abcrrCrrrDr2r$�<module>rFs�����������#�#�#�#�#�#�B��%:�E�$B�38�7<�5:�5:�9>�6;�27�37�;?�	$&�	$&����3�3�3�3�3�3�3�3�3�3r2

?>