Skip to content

Commit d207fa4

Browse files
committed
fix: flake formatting errors in example scripts
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
1 parent 5d37cb9 commit d207fa4

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/advanced/send_all.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""Send all notes and CCs with all possible values an all 16 channels."""
2+
"""Send all notes and CCs with all possible values on all 16 channels."""
33

44
import argparse
55
import logging
@@ -60,20 +60,21 @@
6060
for chan in channels:
6161
for note in range(128):
6262
log.debug(
63-
f"Sending NOTE ON: ch={chan+1:02}, note={note:03}, vel={args.velocity:03}"
63+
f"Sending NOTE ON: ch={chan + 1:02}, note={note:03}, vel={args.velocity:03}"
6464
)
6565
midiout.send_message([NOTE_ON | chan, note, args.velocity])
6666
time.sleep(args.delay)
6767
log.debug(
68-
f"Sending NOTE OFF: ch={chan+1:02}, note={note:03}, vel={args.off_velocity:03}"
68+
f"Sending NOTE OFF: ch={chan + 1:02}, "
69+
f"note={note:03}, vel={args.off_velocity:03}"
6970
)
7071
midiout.send_message([NOTE_OFF | chan, note, args.off_velocity])
7172
time.sleep(args.delay)
7273

7374
for chan in channels:
7475
for cc in range(128):
7576
for val in range(128):
76-
log.debug(f"Sending CONTROL_CHANGE: ch={chan+1:02}, cc={cc:03}, val={val:03}")
77+
log.debug(f"Sending CONTROL_CHANGE: ch={chan + 1:02}, cc={cc:03}, val={val:03}")
7778
midiout.send_message([CONTROL_CHANGE | chan, cc, val])
7879
time.sleep(args.delay)
7980
except (EOFError, KeyboardInterrupt):

examples/joystick/joystick2midi.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def update(self, value, threshold):
7575
while not done:
7676
# Possible joystick actions: JOYAXISMOTION, JOYBALLMOTION, JOYBUTTONDOWN,
7777
# JOYBUTTONUP, JOYHATMOTION
78-
for event in pygame.event.get(): # User did something.
79-
if event.type == pygame.QUIT: # If user clicked close.
80-
done = True # Flag that we are done so we exit this loop.
78+
for event in pygame.event.get(): # User did something.
79+
if event.type == pygame.QUIT: # If user clicked close.
80+
done = True # Flag that we are done so we exit this loop.
8181
elif event.type == pygame.JOYBUTTONUP:
8282
print("Joystick button {} released.".format(event.button))
8383
if event.button == 2: # 'X' button
@@ -104,7 +104,6 @@ def update(self, value, threshold):
104104
print("SEND: {!r}".format(msg))
105105
midiout.send_message(msg)
106106

107-
108107
# Limit poll rate to UPDATES_PER_SECOND.
109108
clock.tick(UPDATES_PER_SECOND)
110109
except KeyboardInterrupt:

0 commit comments

Comments
 (0)