MCPcopy Index your code
hub / github.com/bitsadmin/wesng / configure_color

Function configure_color

wes.py:61–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60
61def configure_color():
62 # Check availability of the termcolor library
63 try:
64 global colored
65 from termcolor import colored
66
67 except (ImportError, ModuleNotFoundError):
68 logging.warning('termcolor module not installed. To show colored output, '
69 'install termcolor using: pip{} install termcolor'.format(sys.version_info.major))
70 pass
71
72 # Also check availability of the colorama library in case of Windows
73 try:
74 if os.name == 'nt':
75 import colorama
76 colorama.init()
77 except (ImportError, ModuleNotFoundError):
78 logging.warning('colorama module not installed. To show colored output in Windows, '
79 'install colorama using: pip{} install colorama'.format(sys.version_info.major))
80 pass
81
82
83class WesException(Exception):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected