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_keys.py | |
parent | e26d163debc9f55a89a27f94a43771526d2ff0b7 (diff) | |
parent | 03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315 (diff) | |
download | ranger-1c90e610de6591e8052a1056c775219b5e767002.tar.gz |
Merge branch 'lint'
Diffstat (limited to 'doc/tools/print_keys.py')
-rwxr-xr-x | doc/tools/print_keys.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/doc/tools/print_keys.py b/doc/tools/print_keys.py index 73091db4..936d9bf0 100755 --- a/doc/tools/print_keys.py +++ b/doc/tools/print_keys.py @@ -3,18 +3,21 @@ You can use this tool to find out values of keypresses """ -from curses import * +from __future__ import (absolute_import, print_function) -sep = '; ' +import curses -@wrapper -def main(w): - mousemask(ALL_MOUSE_EVENTS) - mouseinterval(0) +SEPARATOR = '; ' + + +@curses.wrapper +def main(window): + curses.mousemask(curses.ALL_MOUSE_EVENTS) + curses.mouseinterval(0) while True: - ch = w.getch() - if ch == KEY_MOUSE: - w.addstr(repr(getmouse()) + sep) + char = window.getch() + if char == curses.KEY_MOUSE: + window.addstr(repr(curses.getmouse()) + SEPARATOR) else: - w.addstr(str(ch) + sep) + window.addstr(str(char) + SEPARATOR) |