mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 19:40:08 +01: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 argparse
|
||||
import evdev
|
||||
import evdev.ecodes
|
||||
import pyudev
|
||||
try:
|
||||
import evdev
|
||||
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):
|
||||
|
|
|
|||
|
|
@ -26,9 +26,15 @@
|
|||
|
||||
import sys
|
||||
import argparse
|
||||
import evdev
|
||||
import evdev.ecodes
|
||||
import pyudev
|
||||
try:
|
||||
import evdev
|
||||
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):
|
||||
|
|
|
|||
|
|
@ -26,9 +26,15 @@
|
|||
|
||||
import sys
|
||||
import argparse
|
||||
import evdev
|
||||
import evdev.ecodes
|
||||
import pyudev
|
||||
try:
|
||||
import evdev
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue