HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/clconfig/__pycache__/ui_config_lib.cpython-37.pyc
B

y��ny����@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlZdd	lmZdd
lmZGdd�de�Zd
Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN�)�boolean_to_0_1)�FormattedException)�exec_utility)�UIConfig)�check_quota_enabled)�Feature)�is_panel_feature_supportedc@seZdZdS)�UIConfigExceptionN)�__name__�
__module__�__qualname__�rr�py/clconfig/ui_config_lib.pyrsrz+/usr/share/l.v.e-manager/utils/dynamicui.pycCstt����S)a6
       Retrives UI settings from config file
       :return: dict. For example:
           {'inodeLimits': {'showUserInodesUsage': False},
            'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False,
                           'hidePHPextensions': True}
           }
    )�filter_flagsrZ
get_configrrrr�
get_ui_configs	rc
Cs�yttdgdd�\}}}Wn<tk
rV}ztdt|�dtid���Wdd}~XYnX|dkr~td|d	|dtid���dS)
Nz--sync-conf=allT)�stderrz Can't execute file %(ctl_cmd)s: Zctl_cmd)�message�contextrz#Error while executing %(ctl_cmd)s: � )r�DYNAMIC_UI_CTL_CMD�OSErrorr�str)Zretcode�out�err�errr�
refresh_panel*s rc	CsvyNt|dd�}ddd�}d||}ttjd�}tj|dd	|tjd
�Wntjtfk
rhYnXt	|�dS)a
    Sets UI settings to UI config file
    Using subfunction _set_ui_config
    :param parameters_dict: Parameters to set dictionary. For example:
        {'inodeLimits': {'showUserInodesUsage': False},
         'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False,
                        'hidePHPextensions': True}
        }
    :return: None
    �
uiSettings�
hidePythonAppZdisabledZenabled)�0�1zFcloudlinux-selector set --json --interpreter python --selector-status �wTz	/bin/bash)�shell�
executable�stdoutrN)
r�open�os�devnull�
subprocessZ
check_callZSTDOUTZCalledProcessError�KeyError�_set_ui_config)�parameters_dictZenablepythonappZ
lve_to_selectZ
py_commandZFNULLrrr�
set_ui_config5s

r-cCst��|�t�dS)aW
    Sets UI settings to config file
    :param parameters_dict: Parameters to set dictionary. For example:
        {'inodeLimits': {'showUserInodesUsage': False},
         'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False,
                        'hidePHPextensions': True}
        }
    :return: None
    N)rZ
set_configr)r,rrrr+Ss
r+cCsvt|�d��yt�dk	r$|�d�Wntk
r:YnXy ttj�sZ|�di��d�Wntk
rpYnX|S)NrZinodeLimitsZhideLVEUserStat)�panel_filter�getr�popr*r
r	ZLVE)Zmapped_flagsrrrrbs

rcCs�t��rttj�s|�d�t��s.ttj�s8|�d�ttj�sL|�d�ttj	�s`|�d�ttj
�s~|�d�|�d�dS)z�
    Function that filters UI Settings dictionary
    depending on panel type
    :param ui_settings: UI Settings that is filtered
    ZhideRubyApprZ
hideNodeJsAppZhideXrayAppZ
hidePhpAppZhidePHPextensionsN)�detectZ	is_cpanelr
r	Z
RUBY_SELECTORr0Zis_pleskZPYTHON_SELECTORZNODEJS_SELECTORZXRAYZPHP_SELECTOR)Zui_settingsrrrr.qs








r.)Z
__future__rr'r)Zclconfig_utilsrZclcommon.clexceptionrZcllimits.librZclcommon.ui_configrZclcommon.clquotarZcldetectlibr1Zclcommon.constr	Zclcommon.cpapir
rrrrr-r+rr.rrrr�<module>
s$