Skip to content

Commit 475f919

Browse files
authored
Merge pull request #3083 from adafruit/TheKitty-patch-12
Update ANSI_color_terminal.py
2 parents 9b3ef79 + 06a13af commit 475f919

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Fruit_Jam/CircuitPython_DVI_Video/ANSI_color_terminal.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
#
44
# SPDX-License-Identifier: MIT
55
#
6+
# Make an adafruit_color_terminal terminal with ASCI escape character support
7+
# This uses a Code Page 437 LVGL font to draw a box also
8+
#
69
import gc
710
import supervisor
8-
import displayio
11+
import displayio
912
from lvfontio import OnDiskFont
1013
from adafruit_fruitjam.peripherals import request_display_config
1114
from adafruit_color_terminal import ColorTerminal
@@ -47,13 +50,13 @@ def out_char(value, row, column, color):
4750

4851
def set_color(palette_index):
4952
"""Set FOREGROUND color only"""
50-
if not (0 <= palette_index <= 7):
53+
if not (0 <= palette_index <= 7): # pylint: disable=superfluous-parens
5154
raise ValueError("Palette index must be between 0 and 7")
5255
terminal.write(f"\033[3{palette_index}m")
5356

5457
def set_bgcolor(palette_index):
5558
"""Set BACKGROUND color only"""
56-
if not (0 <= palette_index <= 7):
59+
if not (0 <= palette_index <= 7): # pylint: disable=superfluous-parens
5760
raise ValueError("Palette index must be between 0 and 7")
5861
terminal.write(f"\033[4{palette_index}m")
5962

0 commit comments

Comments
 (0)