From da301e538ab78ddf14de085e2d474fd45cab7d00 Mon Sep 17 00:00:00 2001 From: Mecaneer23 <74385377+Mecaneer23@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:06:55 -0500 Subject: [PATCH] feat: add test.py as a tool --- tools/test.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tools/test.py diff --git a/tools/test.py b/tools/test.py new file mode 100644 index 0000000..5c3f8b4 --- /dev/null +++ b/tools/test.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Tester for acurses""" + +# import curses +import src.acurses as curses + +def _main(stdscr: curses.window): + curses.use_default_colors() + for i, color in enumerate( + [ + curses.COLOR_RED, + curses.COLOR_GREEN, + curses.COLOR_YELLOW, + curses.COLOR_BLUE, + curses.COLOR_MAGENTA, + curses.COLOR_CYAN, + curses.COLOR_WHITE, + ], + start=1, + ): + curses.init_pair(i, color, -1) + # stdscr.box() + # stdscr.addstr(1, 1, "Hello, world!", curses.color_pair(6)) + # win = curses.newwin(3, 7, 3, 3) + # win.addstr(1, 1, str(win._height)) + # win.clear() + # stdscr.refresh() + # win.box() + # win.refresh() + # win.addstr(1, 1, "Bold text", color_pair(2)) + # win.clear() + # stdscr.addstr(1, 1, "Bold text", color_pair(5) | A_STANDOUT) + while True: + x = stdscr.getch() + stdscr.addstr(str(x) + "\n") + if x == 27: + y = stdscr.getch() + stdscr.addstr(str(y) + ":") + if x == 113: + break + # stdscr.refresh() + + +if __name__ == "__main__": + curses.wrapper(_main)