8000 add repr · todbot/CircuitPython_TMIDI@30633c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30633c3

Browse files
committed
add repr
1 parent 20b9e41 commit 30633c3

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

tmidi.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,26 @@ def _is_channel_message(status_byte):
148148
return status_byte >= NOTE_OFF and status_byte < SYSEX
149149

150150

151-
def _read_n_bytes(port, buf, dest, num_bytes):
152-
while num_bytes:
153-
if port.readinto(buf):
154-
dest.append(buf[0])
155-
num_bytes -= 1
156-
157-
158-
def _read_byte_works(port):
159-
while True:
160-
buf = port.read(1)
161-
if buf:
162-
return buf[0]
163-
164-
165151
def _read_byte(port):
166152
while not (buf := port.read(1)):
167153
pass
168154
return buf[0]
169155

170156

157+
# def _read_n_bytes(port, buf, dest, num_bytes):
158+
# while num_bytes:
159+
# if port.readinto(buf):
160+
# dest.append(buf[0])
161+
# num_bytes -= 1
162+
163+
164+
# def _read_byte_works(port):
165+
# while True:
166+
# buf = port.read(1)
167+
# if buf:
168+
# return buf[0]
169+
170+
171171
class Message:
172172
"""
173173
MIDI Message.
@@ -205,6 +205,9 @@ def __bytes__(self):
205205
return bytes([status_byte, self.data0])
206206
return bytes([status_byte])
207207

208+
def __repr__(self):
209+
return self.__str__()
210+
208211
# pylint: disable=consider-using-f-string
209212
def __str__(self):
210213
mtype = self.type

0 commit comments

Comments
 (0)
0