summary refs log tree commit diff stats
path: root/doc/tools/print_keys.py
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-20 12:07:53 +0100
committernfnty <git@nfnty.se>2017-01-20 12:07:53 +0100
commit1c90e610de6591e8052a1056c775219b5e767002 (patch)
tree69b56f67dee1d6dfcea869de897846baaded3fa6 /doc/tools/print_keys.py
parente26d163debc9f55a89a27f94a43771526d2ff0b7 (diff)
parent03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315 (diff)
downloadranger-1c90e610de6591e8052a1056c775219b5e767002.tar.gz
Merge branch 'lint'
Diffstat (limited to 'doc/tools/print_keys.py')
-rwxr-xr-xdoc/tools/print_keys.py23
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)