summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-24 21:26:13 +0200
committermathieui <mathieui@mathieui.net>2014-04-24 21:26:13 +0200
commit1bd9f78fe6ae8a7bac66dbcb91751c68f960809d (patch)
tree459a75b3a811112d628945b71397fcc3bc874971
parent828f60fcb8eccf9cdd2be9d7164b68839161fff7 (diff)
downloadpoezio-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.py15
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()
+