@@ -58,31 +58,13 @@ import gles3_builders
5858import glsl_builders
5959import methods
6060import scu_builders
61- from methods import print_error , print_warning
61+ from methods import Ansi , print_error , print_info , print_warning
6262from platform_methods import architecture_aliases , architectures , compatibility_platform_aliases
6363
6464if ARGUMENTS .get ("target" , "editor" ) == "editor" :
6565 _helper_module ("editor.editor_builders" , "editor/editor_builders.py" )
6666 _helper_module ("editor.template_builders" , "editor/template_builders.py" )
6767
68- # Enable ANSI escape code support on Windows 10 and later (for colored console output).
69- # <https://github.com/python/cpython/issues/73245>
70- if sys .stdout .isatty () and sys .platform == "win32" :
71- try :
72- from ctypes import WinError , byref , windll # type: ignore
73- from ctypes .wintypes import DWORD # type: ignore
74-
75- stdout_handle = windll .kernel32 .GetStdHandle (DWORD (- 11 ))
76- mode = DWORD (0 )
77- if not windll .kernel32 .GetConsoleMode (stdout_handle , byref (mode )):
78- raise WinError ()
79- mode = DWORD (mode .value | 4 )
80- if not windll .kernel32 .SetConsoleMode (stdout_handle , mode ):
81- raise WinError ()
82- except Exception as e :
83- methods ._colorize = False
84- print_error (f"Failed to enable ANSI escape code support, disabling color output.\n { e } " )
85-
8668# Scan possible build platforms
8769
8870platform_list = [] # list of platforms
@@ -635,7 +617,7 @@ detect.configure(env)
635617
636618print (f'Building for platform "{ env ["platform" ]} ", architecture "{ env ["arch" ]} ", target "{ env ["target" ]} ".' )
637619if env .dev_build :
638- print ( "NOTE: Developer build, with debug optimization level and debug symbols (unless overridden)." )
620+ print_info ( " Developer build, with debug optimization level and debug symbols (unless overridden)." )
639621
640622# Enforce our minimal compiler version requirements
641623cc_version = methods .get_compiler_version (env )
@@ -1111,10 +1093,10 @@ def print_elapsed_time():
11111093 time_centiseconds = round ((elapsed_time_sec % 1 ) * 100 )
11121094 print (
11131095 "{}[Time elapsed: {}.{:02}]{}" .format (
1114- methods . ANSI .GRAY ,
1096+ Ansi .GRAY ,
11151097 time .strftime ("%H:%M:%S" , time .gmtime (elapsed_time_sec )),
11161098 time_centiseconds ,
1117- methods . ANSI .RESET ,
1099+ Ansi .RESET ,
11181100 )
11191101 )
11201102
0 commit comments