boon

unix terminal framework
git clone https://git.ce9e.org/boon.git

commit
11d0b6ba5936182cc7f2ecf33b1a0eb7a13f3f13
parent
d54149967820d8c28fee3eae6bfb9f987ee10a56
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-07-12 18:43
rename termios_reset() to tty_restore()

Diffstat

M boon.py 6 +++---

1 files changed, 3 insertions, 3 deletions


diff --git a/boon.py b/boon.py

@@ -54,7 +54,7 @@ def get_cap(cap, *args):
   54    54 
   55    55 
   56    56 @contextmanager
   57    -1 def termios_reset(fd):
   -1    57 def tty_restore(fd):
   58    58 	old = termios.tcgetattr(fd)
   59    59 	try:
   60    60 		yield
@@ -69,7 +69,7 @@ def fullscreen():
   69    69 	sys.stdout.flush()
   70    70 	try:
   71    71 		fd = sys.stdin.fileno()
   72    -1 		with termios_reset(fd):
   -1    72 		with tty_restore(fd):
   73    73 			tty.setcbreak(fd)
   74    74 			yield
   75    75 	finally:
@@ -85,7 +85,7 @@ def getch(timeout=0.5):
   85    85 		r, _w, _e = select.select([fd], [], [], timeout)
   86    86 	except select.error:
   87    87 		return
   88    -1 	with termios_reset(fd):
   -1    88 	with tty_restore(fd):
   89    89 		flags = termios.tcgetattr(fd)
   90    90 		flags[6][termios.VMIN] = 0
   91    91 		flags[6][termios.VTIME] = 0