MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / print_ansi

Function print_ansi

scripts/compile_cpp.py:140–146  ·  view source on GitHub ↗

Print a message. Uses the given ANSI codes if specified. Does not add newline. Does not print color if the `NO_COLOR` environment variable is set.

(message: str, *codes: ANSI)

Source from the content-addressed store, hash-verified

138
139
140def print_ansi(message: str, *codes: ANSI) -> None:
141 """Print a message. Uses the given ANSI codes if specified. Does not add newline. Does not print color if the `NO_COLOR` environment variable is set."""
142 if len(codes) > 0 and not no_color:
143 seq = ";".join(str(c.value) for c in codes)
144 print(f"\033[{seq}m{message}\033[{ANSI.reset.value}m", end="")
145 else:
146 print(message, end="")
147
148
149def print_if_verbose(message: str, *codes: ANSI) -> None:

Callers 3

print_if_verboseFunction · 0.85
print_key_valuesFunction · 0.85
print_error_and_exitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected