From 1bd9f78fe6ae8a7bac66dbcb91751c68f960809d Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 24 Apr 2014 21:26:13 +0200 Subject: Improve src/theming.py (print the colors and do not pollute the terminal) --- src/theming.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/theming.py b/src/theming.py index 9e285378..71ed760c 100644 --- a/src/theming.py +++ b/src/theming.py @@ -516,7 +516,16 @@ if __name__ == '__main__': s = curses.initscr() curses.start_color() curses.use_default_colors() - s.addstr('%s' % curses.COLORS, to_curses_attr((3, -1, 'a'))) + s.addstr('%s colors detected\n\n' % curses.COLORS, to_curses_attr((3, -1))) + for i in range(curses.COLORS): + s.addstr('%s ' % i, to_curses_attr((i, -1))) + s.addstr('\n') s.refresh() - s.getkey() - curses.endwin() + try: + s.getkey() + except KeyboardInterrupt: + pass + finally: + curses.endwin() + print() + -- cgit v1.2.3