rename class TUI to App, change StdOutWrapper to a context manager and add idea of a main_loop() for the App class

This commit is contained in:
2020-01-14 08:59:13 +01:00
parent 033cb92dc4
commit d0eabd3252
7 changed files with 186 additions and 145 deletions

View File

@@ -15,7 +15,7 @@ import curses
import locale
from pylib.data import seq
from pylib.function import sine_wave, cosine_wave, hypotrochoid, to_str
from pylib.tui import TUI
from pylib.tui import App
locale.setlocale(locale.LC_ALL, '')
CODE = locale.getpreferredencoding()
@@ -115,7 +115,7 @@ def main(delay=1):
"""
no window change for mouse events and resize events.
"""
tui = TUI(delay)
tui = App(delay)
initscr = tui.initscr
try:
tui.last_pressed_ch = 0 # getch() Note that the integer returned does not have to be in ASCII range: function keys, keypad keys and so on return numbers higher than 256.