From 498a693853a2714edf2e24224ba281550718088b Mon Sep 17 00:00:00 2001 From: Anthony Liao Date: Thu, 5 Oct 2023 12:34:28 -0400 Subject: [PATCH] added test file --- .../utils/mil_tools/scripts/preflightUI.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 mil_common/utils/mil_tools/scripts/preflightUI.py diff --git a/mil_common/utils/mil_tools/scripts/preflightUI.py b/mil_common/utils/mil_tools/scripts/preflightUI.py new file mode 100755 index 000000000..7f7e9127a --- /dev/null +++ b/mil_common/utils/mil_tools/scripts/preflightUI.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +import blessed + +inp = "" +term = blessed.Terminal() +pos = 0 + +while inp != "q": + maxPos = 3 + height, width = term.height, term.width + + # reprint line selected -> term.on_green"message" + + print(term.home + term.clear + term.blink + term.on_green("pressed ") + repr(inp)) + + print("testing screen\n") + print("checklist") + print("hiiardware checklist") + + print(term.move_y(term.height // 2)) + print(term.black_on_darkkhaki(term.center("press any key"))) + + with term.cbreak(): + inp = term.inkey() + if inp == "k" or inp == "KEY_UP": + if pos == 0: + pos = maxPos + else: + pos -= 1 + + if inp == "j" or inp == "KEY_DOWN": + if pos == maxPos: + pos = 0 + else: + pos += 1