Skip to content

Linted #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adafruit_featherwing/alphanum_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"

import board
import adafruit_ht16k33.segments as segments
from adafruit_ht16k33 import segments
from adafruit_featherwing.led_segments import Segments


Expand Down
3 changes: 1 addition & 2 deletions adafruit_featherwing/gps_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def __init__(self, update_period=1000, baudrate=9600):
if update_period < 250:
raise ValueError("Update Frequency be at least 250 milliseconds")
timeout = update_period // 1000 + 2
if timeout < 3:
timeout = 3
timeout = max(timeout, 3)

self._uart = busio.UART(board.TX, board.RX, baudrate=baudrate, timeout=timeout)
self._gps = adafruit_gps.GPS(self._uart, debug=False)
Expand Down
2 changes: 1 addition & 1 deletion adafruit_featherwing/matrix_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"

import board
import adafruit_ht16k33.matrix as matrix
from adafruit_ht16k33 import matrix

from adafruit_featherwing.auto_writeable import AutoWriteable

Expand Down
2 changes: 1 addition & 1 deletion adafruit_featherwing/sevensegment_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"

import board
import adafruit_ht16k33.segments as segments
from adafruit_ht16k33 import segments
from adafruit_featherwing.led_segments import Segments


Expand Down
11 changes: 5 additions & 6 deletions examples/featherwing_keyboard_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
kbd_featherwing.neopixel[0] = 0x002244

try:
f = open("/sd/tft_featherwing.txt", "w")
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()
with open("/sd/tft_featherwing.txt", "w") as f:
f.write("Blinka\nBlackberry Q10 Keyboard")

with open("/sd/tft_featherwing.txt", "r") as f:
print(f.read())

f = open("/sd/tft_featherwing.txt", "r")
print(f.read())
f.close()
except OSError as error:
print("Unable to write to SD Card.")

Expand Down
11 changes: 5 additions & 6 deletions examples/featherwing_tft24_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
tft_featherwing = tft_featherwing_24.TFTFeatherWing24()

try:
f = open("/sd/tft_featherwing.txt", "w")
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()
with open("/sd/tft_featherwing.txt", "w") as f:
f.write("Blinka\nBlackberry Q10 Keyboard")

with open("/sd/tft_featherwing.txt", "r") as f:
print(f.read())

f = open("/sd/tft_featherwing.txt", "r")
print(f.read())
f.close()
except OSError as error:
print("Unable to write to SD Card.")

Expand Down
14 changes: 8 additions & 6 deletions examples/featherwing_tft35_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
tft_featherwing = tft_featherwing_35.TFTFeatherWing35()

try:
f = open("/sd/tft_featherwing.txt", "w")
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()
with open( # pylint: disable=unspecified-encoding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dherrada You missed two :)

"/sd/tft_featherwing.txt", "w"
) as f:
f.write("Blinka\nBlackberry Q10 Keyboard")

f = open("/sd/tft_featherwing.txt", "r")
print(f.read())
f.close()
with open( # pylint: disable=unspecified-encoding
"/sd/tft_featherwing.txt", "r"
) as f:
print(f.read())
except OSError as error:
print("Unable to write to SD Card.")

Expand Down