_[" d dl Z d dlZd dlmZ d dlmZ d dlmZ d dl m Z d dlmZ d dl mZ dd lmZ G d de ZdZd Zd Zd Zd Zd Zd ZdS ) N)FormattedException)check_quota_enabled)Feature)is_panel_feature_supported)UIConfig)exec_utility )boolean_to_0_1c e Zd ZdS )UIConfigExceptionN)__name__ __module____qualname__ py/clconfig/ui_config_lib.pyr r s Dr r z+/usr/share/l.v.e-manager/utils/dynamicui.pyc \ t t 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_flagsr get_configr r r get_ui_configr s" --//000r c t t dgd \ } }}n<# t $ r/}t dt | z dt id |d }~ww xY w| dk r"t d|z d z |z dt id d S ) Nz--sync-conf=allT)stderrz Can't execute file %(ctl_cmd)s: ctl_cmd)messagecontextr z#Error while executing %(ctl_cmd)s: )r DYNAMIC_UI_CTL_CMDOSErrorr str)retcodeouterres r refresh_panelr$ * s U();>O=PY]^^^cc U U U,NQTUVQWQW,W-68J,K!M !M N NST UU !||,QTW,WZ],]`c,c-68J,K!M !M N N N |s A*AAc t | d d }ddd}d|| z }t j |ddt j t j n# t j t f$ r Y nw xY wt | d S )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 hidePythonAppdisabledenabled)01zFcloudlinux-selector set --json --interpreter python --selector-status Tz /bin/bash)shell executablestdoutr N)r subprocess check_callDEVNULLSTDOUTCalledProcessErrorKeyError_set_ui_config)parameters_dictenablepythonapp lve_to_select py_commands r set_ui_configr: 5 s (_\-J?-[)[\\'i88 _O,- j%/%7 @Q S S S S S)84 ?#####s AA A54A5c d t | 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)r set_configr$ )r6 s r r5 r5 S s) JJ/***OOOOOr c \ t | d t | d n# t $ r Y nw xY w t t j s)| di d n# t $ r Y nw xY w| S )Nr&