Tests: tidy up printbuf().

pull/7/head
Peter Hinch 2018-06-11 08:21:55 +01:00
rodzic 2693472af6
commit ee1dd76bdc
5 zmienionych plików z 5 dodań i 10 usunięć

Wyświetl plik

@ -11,8 +11,7 @@ MP_STREAM_POLL = const(3)
MP_STREAM_ERROR = const(-1)
def printbuf(this_io):
for ch in this_io.wbuf[:this_io.wprint_len]:
print(chr(ch), end='')
print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='')
class MyIO(io.IOBase):
def __init__(self):

Wyświetl plik

@ -12,8 +12,7 @@ MP_STREAM_POLL = const(3)
MP_STREAM_ERROR = const(-1)
def printbuf(this_io):
for ch in this_io.wbuf[:this_io.wprint_len]:
print(chr(ch), end='')
print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='')
this_io.wbuf = b''
class MyIO(io.IOBase):

Wyświetl plik

@ -51,8 +51,7 @@ class MyIOR(io.IOBase):
# a ready status. For the demo it stores the characters in .wbuf for printing.
def printbuf(this_io):
for x in range(this_io.wprint_len):
print(chr(this_io.wbuf[x]), end = '')
print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='')
class MyIOW(io.IOBase):
def __init__(self):

Wyświetl plik

@ -20,8 +20,7 @@ MP_STREAM_POLL = const(3)
MP_STREAM_ERROR = const(-1)
def printbuf(this_io):
for ch in this_io.wbuf[:this_io.wprint_len]:
print(chr(ch), end='')
print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='')
class MyIO(io.IOBase):
def __init__(self, read=False, write=False):

Wyświetl plik

@ -20,8 +20,7 @@ MP_STREAM_POLL = const(3)
MP_STREAM_ERROR = const(-1)
def printbuf(this_io):
for ch in this_io.wbuf[:this_io.wprint_len]:
print(chr(ch), end='')
print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='')
class MyIO(io.IOBase):
def __init__(self, read=False, write=False):