Skip to content

Commit e7a5c93

Browse files
committed
Merge remote-tracking branch 'upstream/linting' into feature/add-typehints
2 parents c75c304 + 9c5d052 commit e7a5c93

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

examples/featherwing_keyboard_featherwing.py

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

2222
try:
23-
f = open("/sd/tft_featherwing.txt", "w")
23+
f = open( # pylint: disable=unspecified-encoding,consider-using-with
24+
"/sd/tft_featherwing.txt", "w"
25+
)
2426
f.write("Blinka\nBlackberry Q10 Keyboard")
2527
f.close()
2628

27-
f = open("/sd/tft_featherwing.txt", "r")
29+
f = open( # pylint: disable=unspecified-encoding,consider-using-with
30+
"/sd/tft_featherwing.txt", "r"
31+
)
2832
print(f.read())
2933
f.close()
3034
except OSError as error:

examples/featherwing_tft24_simpletest.py

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

1515
try:
16-
f = open("/sd/tft_featherwing.txt", "w")
17-
f.write("Blinka\nBlackberry Q10 Keyboard")
18-
f.close()
16+
with open( # pylint: disable=unspecified-encoding
17+
"/sd/tft_featherwing.txt", "w"
18+
) as f:
19+
f.write("Blinka\nBlackberry Q10 Keyboard")
20+
21+
with open( # pylint: disable=unspecified-encoding
22+
"/sd/tft_featherwing.txt", "r"
23+
) as f:
24+
print(f.read())
1925

20-
f = open("/sd/tft_featherwing.txt", "r")
21-
print(f.read())
22-
f.close()
2326
except OSError as error:
2427
print("Unable to write to SD Card.")
2528

examples/featherwing_tft35_simpletest.py

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

1515
try:
16-
f = open("/sd/tft_featherwing.txt", "w")
16+
f = open( # pylint: disable=unspecified-encoding,consider-using-with
17+
"/sd/tft_featherwing.txt", "w"
18+
)
1719
f.write("Blinka\nBlackberry Q10 Keyboard")
1820
f.close()
1921

20-
f = open("/sd/tft_featherwing.txt", "r")
22+
f = open( # pylint: disable=unspecified-encoding,consider-using-with
23+
"/sd/tft_featherwing.txt", "r"
24+
)
2125
print(f.read())
2226
f.close()
2327
except OSError as error:

0 commit comments

Comments
 (0)