mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-05 19:18:03 +02:00
tools: handle missing evdev/pyudev modules with a better error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 67bfb5cf2e)
This commit is contained in:
parent
1593d7da32
commit
e35c202df7
3 changed files with 27 additions and 9 deletions
|
|
@ -26,9 +26,15 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import evdev
|
try:
|
||||||
import evdev.ecodes
|
import evdev
|
||||||
import pyudev
|
import evdev.ecodes
|
||||||
|
import pyudev
|
||||||
|
except ModuleNotFoundError as e:
|
||||||
|
print('Error: {}'.format(str(e)), file=sys.stderr)
|
||||||
|
print('One or more python modules are missing. Please install those '
|
||||||
|
'modules and re-run this tool.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
class Range(object):
|
class Range(object):
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,15 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import evdev
|
try:
|
||||||
import evdev.ecodes
|
import evdev
|
||||||
import pyudev
|
import evdev.ecodes
|
||||||
|
import pyudev
|
||||||
|
except ModuleNotFoundError as e:
|
||||||
|
print('Error: {}'.format(str(e)), file=sys.stderr)
|
||||||
|
print('One or more python modules are missing. Please install those '
|
||||||
|
'modules and re-run this tool.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
class Range(object):
|
class Range(object):
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,15 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import evdev
|
try:
|
||||||
import evdev.ecodes
|
import evdev
|
||||||
import pyudev
|
import evdev.ecodes
|
||||||
|
import pyudev
|
||||||
|
except ModuleNotFoundError as e:
|
||||||
|
print('Error: {}'.format(str(e)), file=sys.stderr)
|
||||||
|
print('One or more python modules are missing. Please install those '
|
||||||
|
'modules and re-run this tool.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
MINIMUM_EVENT_COUNT = 1000
|
MINIMUM_EVENT_COUNT = 1000
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue