From 6c5f7d73bc634be4b566f041ff12c6d481fb4207 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 9 Mar 2013 18:50:18 +0100 Subject: move doc/print_{colors,keys}.py to doc/tools/ --- doc/print_colors.py | 23 ----------------------- doc/print_keys.py | 14 -------------- doc/tools/print_colors.py | 23 +++++++++++++++++++++++ doc/tools/print_keys.py | 14 ++++++++++++++ 4 files changed, 37 insertions(+), 37 deletions(-) delete mode 100755 doc/print_colors.py delete mode 100755 doc/print_keys.py create mode 100755 doc/tools/print_colors.py create mode 100755 doc/tools/print_keys.py (limited to 'doc') diff --git a/doc/print_colors.py b/doc/print_colors.py deleted file mode 100755 index ce040b33..00000000 --- a/doc/print_colors.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -""" -You can use this tool to display all supported colors and their color number. -It will exit after a keypress. -""" - -import curses -from curses import * - -@wrapper -def main(win): - def print_all_colors(attr): - for c in range(0, curses.COLORS): - init_pair(c, c, -1) - win.addstr(str(c) + ' ', color_pair(c) | attr) - use_default_colors() - win.addstr("available colors: %d\n\n" % curses.COLORS) - print_all_colors(0) - win.addstr("\n\n") - print_all_colors(A_BOLD) - win.refresh() - win.getch() - diff --git a/doc/print_keys.py b/doc/print_keys.py deleted file mode 100755 index 17d2513b..00000000 --- a/doc/print_keys.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python -""" -You can use this tool to find out values of keypresses -""" - -from curses import * - -sep = '; ' - -@wrapper -def main(w): - while True: - w.addstr(str(w.getch()) + sep) - diff --git a/doc/tools/print_colors.py b/doc/tools/print_colors.py new file mode 100755 index 00000000..ce040b33 --- /dev/null +++ b/doc/tools/print_colors.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +""" +You can use this tool to display all supported colors and their color number. +It will exit after a keypress. +""" + +import curses +from curses import * + +@wrapper +def main(win): + def print_all_colors(attr): + for c in range(0, curses.COLORS): + init_pair(c, c, -1) + win.addstr(str(c) + ' ', color_pair(c) | attr) + use_default_colors() + win.addstr("available colors: %d\n\n" % curses.COLORS) + print_all_colors(0) + win.addstr("\n\n") + print_all_colors(A_BOLD) + win.refresh() + win.getch() + diff --git a/doc/tools/print_keys.py b/doc/tools/print_keys.py new file mode 100755 index 00000000..17d2513b --- /dev/null +++ b/doc/tools/print_keys.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +""" +You can use this tool to find out values of keypresses +""" + +from curses import * + +sep = '; ' + +@wrapper +def main(w): + while True: + w.addstr(str(w.getch()) + sep) + -- cgit 1.4.1-2-gfad0 )
1
2
3
4
5
6
7