terminalwriter: ran linting on file.

This commit is contained in:
TyYan03 2023-12-08 18:14:21 -05:00
parent cb499d7483
commit b6d830a748
1 changed files with 13 additions and 7 deletions

View File

@ -229,7 +229,7 @@ class TerminalWriter:
) )
# Set the terminal formatter to better performing formatters is user environement allows for it # Set the terminal formatter to better performing formatters is user environement allows for it
if os.environ.get('COLORTERM','') in ('truecolor', '24bit'): if os.environ.get("COLORTERM", "") in ("truecolor", "24bit"):
# Create new styling for True Color Formatter # Create new styling for True Color Formatter
class UpdatedTrueStyle(Style): class UpdatedTrueStyle(Style):
# Set color values for the True Color Formatter # Set color values for the True Color Formatter
@ -259,9 +259,14 @@ class TerminalWriter:
Error: ("ansibrightblue"), Error: ("ansibrightblue"),
} }
from pygments.formatters.terminal256 import TerminalTrueColorFormatter from pygments.formatters.terminal256 import (
terminal_formatter = TerminalTrueColorFormatter(style=UpdatedTrueStyle) TerminalTrueColorFormatter,
elif '256' in os.environ.get('TERM', ''): )
terminal_formatter = TerminalTrueColorFormatter(
style=UpdatedTrueStyle
)
elif "256" in os.environ.get("TERM", ""):
# Create new styling for 256 Formatter # Create new styling for 256 Formatter
class Updated256Style(Style): class Updated256Style(Style):
# Set color values for the 256 Formatter # Set color values for the 256 Formatter
@ -292,6 +297,7 @@ class TerminalWriter:
} }
from pygments.formatters.terminal256 import Terminal256Formatter from pygments.formatters.terminal256 import Terminal256Formatter
terminal_formatter = Terminal256Formatter(style=Updated256Style) terminal_formatter = Terminal256Formatter(style=Updated256Style)
else: else:
terminal_formatter = TerminalFormatter( terminal_formatter = TerminalFormatter(