Source code for kwcoco.util.util_rich

"""
Deprecated: use the one in kwutil instead
"""
try:
    from functools import cache
except ImportError:
    from ubelt import memoize as cache


[docs] @cache def _get_rich_print(): try: import rich except ImportError: return print else: return rich.print
[docs] def rich_print(*args, **kwargs): """ Does a rich print if available, otherwise fallback to regular print """ print_func = _get_rich_print() print_func(*args, **kwargs)