diff options
author | nfnty <git@nfnty.se> | 2017-01-20 12:07:53 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-01-20 12:07:53 +0100 |
commit | 1c90e610de6591e8052a1056c775219b5e767002 (patch) | |
tree | 69b56f67dee1d6dfcea869de897846baaded3fa6 /doc/tools/print_colors.py | |
parent | e26d163debc9f55a89a27f94a43771526d2ff0b7 (diff) | |
parent | 03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315 (diff) | |
download | ranger-1c90e610de6591e8052a1056c775219b5e767002.tar.gz |
Merge branch 'lint'
Diffstat (limited to 'doc/tools/print_colors.py')
-rwxr-xr-x | doc/tools/print_colors.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/doc/tools/print_colors.py b/doc/tools/print_colors.py index 8cc944ed..69436778 100755 --- a/doc/tools/print_colors.py +++ b/doc/tools/print_colors.py @@ -4,28 +4,29 @@ You can use this tool to display all supported colors and their color number. It will exit after a keypress. """ +from __future__ import (absolute_import, print_function) + import curses -from curses import * -@wrapper +@curses.wrapper def main(win): def print_all_colors(attr): - for c in range(-1, curses.COLORS): + for color in range(-1, curses.COLORS): try: - init_pair(c, c, 0) + curses.init_pair(color, color, 0) except Exception: pass else: - win.addstr(str(c) + ' ', color_pair(c) | attr) - start_color() + win.addstr(str(color) + ' ', curses.color_pair(color) | attr) + curses.start_color() try: - use_default_colors() + curses.use_default_colors() except Exception: pass win.addstr("available colors: %d\n\n" % curses.COLORS) print_all_colors(0) win.addstr("\n\n") - print_all_colors(A_BOLD) + print_all_colors(curses.A_BOLD) win.refresh() win.getch() |