5/9ePdZddlmZddlmZddlZdZdedefdZd d e d e fd 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 optiondatareturnc|dr#|dd\}}d|zd|idS|tr5|dd\}}d|zd |idSd |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 %sparam)resultcontext:z%s: %%(available_options)savailable_optionsr ) startswithsplit VALUES_STRstrip)rr texts py/cli_utils.pyreplace_paramsrs tOjja(( t)D0gu=MNNN z""Ajja(( e6=/?AA A d Fis_json is_prettyc|rM|r&ttj|dddSttj|ddSt|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)printjsondumps) data_dictrrs rprint_dictionaryr!(sr  9 $*YqDAAA B B B B B $*Y$777 8 8 8 8 8 ir)FF) __doc__ __future__rrrrstrdictrboolr!rrr(s &%%%%%&&&&&& + "$r