summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-04-15 08:36:26 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-04-16 09:32:15 +1000
commit559141495b89e4964960ea6ba92322d9766883ff (patch)
treef5150eda616df8e53c3d08deea5d3fe2e24826a0
parent25f3278b85ec7d1c78bb150eaea52f9c98294ea4 (diff)
scripts: exit with 77 if python-libevdev is missing
This way we pass make check/ninja test even where the module is not available See https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/31#note_879823 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xscripts/keysym-generator.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/keysym-generator.py b/scripts/keysym-generator.py
index a583e80..24b7b83 100755
--- a/scripts/keysym-generator.py
+++ b/scripts/keysym-generator.py
@@ -16,10 +16,20 @@ import logging
import os
import sys
import re
-import libevdev
import subprocess
from pathlib import Path
+try:
+ import libevdev
+except ModuleNotFoundError as e:
+ print(f"Error: {e}", file=sys.stderr)
+ print(
+ "One or more python modules are missing. Please install those "
+ "modules and re-run this tool."
+ )
+ sys.exit(77)
+
+
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s")
logger = logging.getLogger("ksgen")