Add a few missing commands to replay
This commit is contained in:
parent
2cc20e4b27
commit
15c4b1961e
@ -19,10 +19,30 @@ def write(x):
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
|
def set_title(*args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def set_icon(*args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def screen_bell():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def screen_cursor_position(y, x):
|
def screen_cursor_position(y, x):
|
||||||
write(CSI + '%s;%sH' % (y, x))
|
write(CSI + '%s;%sH' % (y, x))
|
||||||
|
|
||||||
|
|
||||||
|
def screen_cursor_forward(amt):
|
||||||
|
write(CSI + '%sC' % amt)
|
||||||
|
|
||||||
|
|
||||||
|
def screen_cursor_back1(amt):
|
||||||
|
write(CSI + '%sD' % amt)
|
||||||
|
|
||||||
|
|
||||||
def screen_designate_charset(which, to):
|
def screen_designate_charset(which, to):
|
||||||
which = '()'[int(which)]
|
which = '()'[int(which)]
|
||||||
to = chr(int(to))
|
to = chr(int(to))
|
||||||
@ -57,6 +77,10 @@ def screen_erase_in_display(how, private):
|
|||||||
write(CSI + ('?' if private else '') + str(how) + 'J')
|
write(CSI + ('?' if private else '') + str(how) + 'J')
|
||||||
|
|
||||||
|
|
||||||
|
def screen_erase_in_line(how, private):
|
||||||
|
write(CSI + ('?' if private else '') + str(how) + 'K')
|
||||||
|
|
||||||
|
|
||||||
def screen_cursor_up2(count):
|
def screen_cursor_up2(count):
|
||||||
write(CSI + '%dA' % count)
|
write(CSI + '%dA' % count)
|
||||||
|
|
||||||
@ -65,6 +89,10 @@ def screen_carriage_return():
|
|||||||
write('\r')
|
write('\r')
|
||||||
|
|
||||||
|
|
||||||
|
def screen_linefeed():
|
||||||
|
write('\n')
|
||||||
|
|
||||||
|
|
||||||
def screen_backspace():
|
def screen_backspace():
|
||||||
write('\x08')
|
write('\x08')
|
||||||
|
|
||||||
@ -77,8 +105,8 @@ def replay(raw):
|
|||||||
for line in raw.splitlines():
|
for line in raw.splitlines():
|
||||||
if line.strip():
|
if line.strip():
|
||||||
cmd, rest = line.partition(' ')[::2]
|
cmd, rest = line.partition(' ')[::2]
|
||||||
if cmd == 'draw':
|
if cmd in {'draw', 'set_title', 'set_icon'}:
|
||||||
draw(rest)
|
globals()[cmd](rest)
|
||||||
else:
|
else:
|
||||||
rest = map(int, rest.split()) if rest else ()
|
rest = map(int, rest.split()) if rest else ()
|
||||||
globals()[cmd](*rest)
|
globals()[cmd](*rest)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user