Skip to content

Linted. #111

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

Merged
merged 2 commits into from
Nov 5, 2021
Merged
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
name: pylint (library code)
types: [python]
args:
- --disable=consider-using-f-string
- --disable=consider-using-f-string,duplicate-code
exclude: "^(docs/|examples/|tests/|setup.py$)"
- id: pylint
name: pylint (example code)
Expand Down
7 changes: 3 additions & 4 deletions adafruit_circuitplayground/bluefruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ def play_mp3(self, file_name):
# Play a specified file.
self.stop_tone()
self._speaker_enable.value = True
with self._audio_out(
board.SPEAKER
) as audio: # pylint: disable=not-callable
mp3file = audiomp3.MP3Decoder(open(file_name, "rb"))
with self._audio_out(board.SPEAKER) as audio, audiomp3.MP3Decoder(
open(file_name, "rb")
) as mp3file: # pylint: disable=not-callable
audio.play(mp3file)
while audio.playing:
pass
Expand Down
5 changes: 3 additions & 2 deletions adafruit_circuitplayground/circuit_playground_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,9 @@ def play_file(self, file_name):
# Play a specified file.
self.stop_tone()
self._speaker_enable.value = True
with self._audio_out(board.SPEAKER) as audio: # pylint: disable=not-callable
wavefile = audiocore.WaveFile(open(file_name, "rb"))
with self._audio_out( # pylint: disable=not-callable
board.SPEAKER
) as audio, audiocore.WaveFile(open(file_name, "rb")) as wavefile:
audio.play(wavefile)
while audio.playing:
pass
Expand Down