summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-10-19 18:04:37 +0200
committerGuillaume Seguin <guillaume@segu.in>2010-10-19 18:04:37 +0200
commit3b0664d914568266a9d7b023651b02d3fefa5d47 (patch)
tree80b144cbadfa2d5ee53a9bec2d8954508267c0ea
parent5a000be1c3e68fe2059c833f07bf0a211e8604da (diff)
downloadkuwii-3b0664d914568266a9d7b023651b02d3fefa5d47.tar.gz
kuwii-3b0664d914568266a9d7b023651b02d3fefa5d47.tar.bz2
Handle missing uinputHEADmaster
-rwxr-xr-xkuwii.py2
-rwxr-xr-xkuwii/uinput.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/kuwii.py b/kuwii.py
index 8b57a88..e5f6f0f 100755
--- a/kuwii.py
+++ b/kuwii.py
@@ -19,7 +19,7 @@ from kuwii import config, actions
try:
from kuwii.uinput import uinput
-except:
+except ImportError:
uinput = None
class KuWii:
diff --git a/kuwii/uinput.py b/kuwii/uinput.py
index ac2e27f..62be9fe 100755
--- a/kuwii/uinput.py
+++ b/kuwii/uinput.py
@@ -3,6 +3,11 @@
import os, struct, fcntl, time, math
from uinput_keymap import keymap
+try:
+ os.open ("/dev/input/uinput", os.O_RDWR)
+except OSError:
+ print "Couldn't open /dev/input/uinput -- keyboard actions disabled"
+ raise ImportError
class uinput: