1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Support NO_COLOR environment variable in doc_status.py

This commit is contained in:
Edward Moulsdale
2025-03-23 18:21:52 +00:00
parent 2303ce843a
commit d7a9a9a951
2 changed files with 4 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ from typing import Dict, List, Set
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../"))
from misc.utility.color import STDOUT_COLOR, Ansi, toggle_color
from misc.utility.color import NO_COLOR, STDOUT_COLOR, Ansi, toggle_color
################################################################################
# Config #
@@ -114,6 +114,8 @@ def validate_tag(elem: ET.Element, tag: str) -> None:
def color(color: str, string: str) -> str:
if NO_COLOR:
return string
color_format = "".join([str(x) for x in colors[color]])
return f"{color_format}{string}{Ansi.RESET}"