§
½@¾j¢ ã ó8 — d Z ddlZdZdedefd„Zdded efd
„ZdS )zÏ
This module serves as a collection of functions needed by various
cloudlinux-* utilities. It should not include any functions specific to a one
single utility as to not pollute it with unnecessary imports.
é NzAvailable values for optionÚdataÚreturnc ó — | d¦ « r#| dd¦ « \ }}d|z d|idœS | t ¦ « r5| dd¦ « \ }}|dz d | ¦ « idœS d
| iS )z
Replacing params in a data string to display an error message for humans.
:param data: error's data for show message
:return: a dictionary suitable for UI
z--ú é z%%(param)s Úparam)ÚresultÚcontextú:z: %%(available_options)sÚavailable_optionsr )Ú
startswithÚsplitÚ
VALUES_STRÚstrip)r r Útexts úpy/cli_utils.pyÚreplace_paramsr sª € 𠇂�tÑÔð MØ—j’j aÑ(Ô(‰ˆˆtØ'¨$Ñ.¸GÀUÐ;KÐLÐLÐL؇‚•zÑ"Ô"ð AØ—j’j aÑ(Ô(‰ˆˆeØÐ!;Ñ;Ø/°·²±´Ð?ðAð Að Aà�dÐÐó FÚis_jsonÚ is_prettyc ó — |rM|r&t t j | dd¬¦ « ¦ « dS t t j | d¬¦ « ¦ « dS t | ¦ « dS )zæ
Print specified dictionary
:param data_dict: data dictionary to print
:param is_json: True - print in JSON, False - in text
:param is_pretty: True - pretty json print, False - none (default)
:return: None
é T)ÚindentÚ sort_keys)r N)ÚprintÚjsonÚdumps)Ú data_dictr r s r Úprint_dictionaryr ' sr € ð ð àð 9Ý•$”*˜Y¨q¸DÐAÑAÔAÑBÔBÐBÐBÐBå•$”*˜Y°$Ð7Ñ7Ô7Ñ8Ô8Ð8Ð8Ð8õ ˆiÑÔÐÐÐr )FF)Ú__doc__r r ÚstrÚdictr Úboolr © r r ú