Skip to content

Commit 39f0c36

Browse files
authored
Merge pull request #111 from kattni/linting
Linted.
2 parents 551345f + 511f55c commit 39f0c36

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
name: pylint (library code)
2525
types: [python]
2626
args:
27-
- --disable=consider-using-f-string
27+
- --disable=consider-using-f-string,duplicate-code
2828
exclude: "^(docs/|examples/|tests/|setup.py$)"
2929
- id: pylint
3030
name: pylint (example code)

adafruit_circuitplayground/bluefruit.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,9 @@ def play_mp3(self, file_name):
158158
# Play a specified file.
159159
self.stop_tone()
160160
self._speaker_enable.value = True
161-
with self._audio_out(
162-
board.SPEAKER
163-
) as audio: # pylint: disable=not-callable
164-
mp3file = audiomp3.MP3Decoder(open(file_name, "rb"))
161+
with self._audio_out(board.SPEAKER) as audio, audiomp3.MP3Decoder(
162+
open(file_name, "rb")
163+
) as mp3file: # pylint: disable=not-callable
165164
audio.play(mp3file)
166165
while audio.playing:
167166
pass

adafruit_circuitplayground/circuit_playground_base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,9 @@ def play_file(self, file_name):
801801
# Play a specified file.
802802
self.stop_tone()
803803
self._speaker_enable.value = True
804-
with self._audio_out(board.SPEAKER) as audio: # pylint: disable=not-callable
805-
wavefile = audiocore.WaveFile(open(file_name, "rb"))
804+
with self._audio_out( # pylint: disable=not-callable
805+
board.SPEAKER
806+
) as audio, audiocore.WaveFile(open(file_name, "rb")) as wavefile:
806807
audio.play(wavefile)
807808
while audio.playing:
808809
pass

0 commit comments

Comments
 (0)