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/__pycache__/cli_utils.cpython-37.opt-1.pyc
B

R`�
1����@sNdZddlmZddlmZddlZdZeed�dd�Zd
e	e	d
�dd�Z
dS)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.
�)�print_function)�absolute_importNzAvailable values for option)�data�returncCsd|�d�r,|�dd�\}}d|d|id�S|�t�r\|�dd�\}}d|d	|��id�Sd
|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 %s�param)�result�context�:z%s: %%(available_options)sZavailable_optionsr	)�
startswith�split�
VALUES_STR�strip)rr�text�r�cli_utils.py�replace_paramss

rF)�is_json�	is_prettycCs>|r2|rttj|ddd��q:ttj|dd��nt|�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)rN)�print�json�dumps)Z	data_dictrrrrr�print_dictionary(s
r)FF)�__doc__Z
__future__rrrr�str�dictr�boolrrrrr�<module>s