gddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZGd d eZd Zd ZdZdZdZdZdZdS)N)FormattedException)check_quota_enabled)Feature)is_panel_feature_supported)UIConfig) exec_utility)boolean_to_0_1ceZdZdS)UIConfigExceptionN)__name__ __module__ __qualname__py/clconfig/ui_config_lib.pyr r sDrr z+/usr/share/l.v.e-manager/utils/dynamicui.pyc\ttS)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_configrrr get_ui_configrs"  --// 0 00rc  ttdgd\}}}n<#t$r/}tdt |zdtid|d}~wwxYw|dkr"td|zd z|zdtiddS) Nz--sync-conf=allT)stderrz Can't execute file %(ctl_cmd)s: ctl_cmd)messagecontextrz#Error while executing %(ctl_cmd)s:  )rDYNAMIC_UI_CTL_CMDOSErrorr str)retcodeouterres r refresh_panelr$*sU();>O=PY]^^^cc UUU,NQTUVQWQW,W-68J,K!M!MNNST UU!||,QTW,WZ],]`c,c-68J,K!M!MNN N|s A*AAc t|dd }ddd}d||z}tj|ddtjtj n#tjt f$rYnwxYwt|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 executablestdoutrN)r subprocess check_callDEVNULLSTDOUTCalledProcessErrorKeyError_set_ui_config)parameters_dictenablepythonapp lve_to_select py_commands r set_ui_configr:5s  (_\-J?-[)[\\'i88 _O,- j%/%7 @Q S S S S S  )8 4     ?#####sAAA54A5cdt|tdS)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$)r6s rr5r5Ss) JJ/***OOOOOrc\t|d t|dn#t$rYnwxYw t t js)|didn#t$rYnwxYw|S)Nr& inodeLimitshideLVEUserStat) panel_filtergetrpopr4rrLVE) mapped_flagss rrrbs!!,//000  ,   ] + + +       )'+66 F   \2 . . 2 23D E E E      s$#A AAAB B)(B)cLtjrttjs|dtjsttjs|dttjs|dttj s|dttj s,|d|ddSdS)z Function that filters UI Settings dictionary depending on panel type :param ui_settings: UI Settings that is filtered hideRubyAppr' hideNodeJsApp hideXrayApp hidePhpApphidePHPextensionsN) detect is_cpanelrr RUBY_SELECTORrBis_pleskPYTHON_SELECTORNODEJS_SELECTORXRAY PHP_SELECTOR) ui_settingss rr@r@qs    '*7+@AA' &&& ) :7;R S S)((( %g&= > >)((( %gl 3 3' &&& %g&: ; ;- %%%+,,,,,--r)r/ cldetectlibrKclcommon.clexceptionrclcommon.clquotarclcommon.constrclcommon.cpapirclcommon.ui_configr cllimits.librclconfig_utilsr r rrr$r:r5rr@rrrr\s8333333000000""""""555555''''''%%%%%%******     *   C 1 1 1NNN$$$<      -----r