diff options
author | mathieui <mathieui@mathieui.net> | 2014-04-24 21:26:13 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-04-24 21:26:13 +0200 |
commit | 1bd9f78fe6ae8a7bac66dbcb91751c68f960809d (patch) | |
tree | 459a75b3a811112d628945b71397fcc3bc874971 | |
parent | 828f60fcb8eccf9cdd2be9d7164b68839161fff7 (diff) | |
download | poezio-1bd9f78fe6ae8a7bac66dbcb91751c68f960809d.tar.gz poezio-1bd9f78fe6ae8a7bac66dbcb91751c68f960809d.tar.bz2 poezio-1bd9f78fe6ae8a7bac66dbcb91751c68f960809d.tar.xz poezio-1bd9f78fe6ae8a7bac66dbcb91751c68f960809d.zip |
Improve src/theming.py (print the colors and do not pollute the terminal)
-rw-r--r-- | src/theming.py | 15 |
1 files changed, 12 insertions, 3 deletions
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() + |