hello API 8 !

This commit is contained in:
Ayush Saini 2023-08-13 17:21:49 +05:30
parent 3a2b6ade68
commit 0284fee95c
1166 changed files with 26061 additions and 375100 deletions

View file

@ -68,7 +68,7 @@ class TerminalColor(Enum):
def _default_color_enabled() -> bool:
"""Return whether we should enable ANSI color codes by default."""
"""Return whether we enable ANSI color codes by default."""
import platform
# If we're not attached to a terminal, go with no-color.
@ -307,15 +307,11 @@ class ClrNever(ClrBase):
_envval = os.environ.get('EFRO_TERMCOLORS')
_color_enabled: bool = (
color_enabled: bool = (
True
if _envval == '1'
else False
if _envval == '0'
else _default_color_enabled()
)
Clr: type[ClrBase]
if _color_enabled:
Clr = ClrAlways
else:
Clr = ClrNever
Clr: type[ClrBase] = ClrAlways if color_enabled else ClrNever