leo_fw.utils module

class leo_fw.utils.CSIColor(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

GREEN = '\x1b[92m'
RED = '\x1b[91m'
RESET = '\x1b[0m'
YELLOW = '\x1b[93m'
leo_fw.utils.is_tool(name: str) bool

! Check whether an executable exists on PATH. @param name Name of the executable @return True if executable exists, False otherwise

leo_fw.utils.parse_yaml(file_path: str)
leo_fw.utils.print_fail(msg: str)
leo_fw.utils.print_ok(msg: str)
leo_fw.utils.print_test_result(res: tuple[bool, str | None])
leo_fw.utils.print_warn(msg: str)
leo_fw.utils.prompt_options(options: list[tuple[str, T]], default: int = 1) T
leo_fw.utils.query_yes_no(question: str, default: str = 'yes') bool

! Ask a yes/no question via input() and return their answer. @param question The question that is presented to the user. @param default The presumed answer if the user just hits <Enter>.

It must be “yes” (the default), “no” or None (meaning an answer is required of the user).

@return True if the answer is “yes”, False otherwise

leo_fw.utils.write_flush(msg: str)

!Write a message to standard output and flush the buffer