Skip to content

Commit 7534428

Browse files
committed
Merge remote-tracking branch 'upstream/patch-fix' into feature/add-typehints
2 parents 1068d88 + d15d62b commit 7534428

7 files changed

+18
-30
lines changed

adafruit_featherwing/alphanum_featherwing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
1616

1717
import board
18-
import adafruit_ht16k33.segments as segments
18+
from adafruit_ht16k33 import segments
1919
from adafruit_featherwing.led_segments import Segments
2020

2121
try:

adafruit_featherwing/gps_featherwing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def __init__(self, update_period: int = 1000, baudrate: int = 9600):
4141
if update_period < 250:
4242
raise ValueError("Update Frequency be at least 250 milliseconds")
4343
timeout = update_period // 1000 + 2
44-
if timeout < 3:
45-
timeout = 3
44+
timeout = max(timeout, 3)
4645

4746
self._uart = busio.UART(board.TX, board.RX, baudrate=baudrate, timeout=timeout)
4847
self._gps = adafruit_gps.GPS(self._uart, debug=False)

adafruit_featherwing/matrix_featherwing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
1717

1818
import board
19-
import adafruit_ht16k33.matrix as matrix
19+
from adafruit_ht16k33 import matrix
2020

2121
from adafruit_featherwing.auto_writeable import AutoWriteable
2222

adafruit_featherwing/sevensegment_featherwing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
1616

1717
import board
18-
import adafruit_ht16k33.segments as segments
18+
from adafruit_ht16k33 import segments
1919
from adafruit_featherwing.led_segments import Segments
2020

2121
try:

examples/featherwing_keyboard_featherwing.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@
2020
kbd_featherwing.neopixel[0] = 0x002244
2121

2222
try:
23-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
24-
"/sd/tft_featherwing.txt", "w"
25-
)
26-
f.write("Blinka\nBlackberry Q10 Keyboard")
27-
f.close()
28-
29-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
30-
"/sd/tft_featherwing.txt", "r"
31-
)
32-
print(f.read())
33-
f.close()
23+
with open("/sd/tft_featherwing.txt", "w") as f:
24+
f.write("Blinka\nBlackberry Q10 Keyboard")
25+
26+
with open("/sd/tft_featherwing.txt", "r") as f:
27+
print(f.read())
28+
3429
except OSError as error:
3530
print("Unable to write to SD Card.")
3631

examples/featherwing_tft24_simpletest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
tft_featherwing = tft_featherwing_24.TFTFeatherWing24()
1414

1515
try:
16-
with open( # pylint: disable=unspecified-encoding
17-
"/sd/tft_featherwing.txt", "w"
18-
) as f:
16+
with open("/sd/tft_featherwing.txt", "w") as f:
1917
f.write("Blinka\nBlackberry Q10 Keyboard")
2018

21-
with open( # pylint: disable=unspecified-encoding
22-
"/sd/tft_featherwing.txt", "r"
23-
) as f:
19+
with open("/sd/tft_featherwing.txt", "r") as f:
2420
print(f.read())
2521

2622
except OSError as error:

examples/featherwing_tft35_simpletest.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@
1313
tft_featherwing = tft_featherwing_35.TFTFeatherWing35()
1414

1515
try:
16-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
16+
with open( # pylint: disable=unspecified-encoding
1717
"/sd/tft_featherwing.txt", "w"
18-
)
19-
f.write("Blinka\nBlackberry Q10 Keyboard")
20-
f.close()
18+
) as f:
19+
f.write("Blinka\nBlackberry Q10 Keyboard")
2120

22-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
21+
with open( # pylint: disable=unspecified-encoding
2322
"/sd/tft_featherwing.txt", "r"
24-
)
25-
print(f.read())
26-
f.close()
23+
) as f:
24+
print(f.read())
2725
except OSError as error:
2826
print("Unable to write to SD Card.")
2927

0 commit comments

Comments
 (0)