mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 05:50:26 +01:00
tools: replay: allow for missing quirks entry in libinput recordings
Older recordings don't have that field so we should just ignore that case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ba24c95b05
commit
ba68cdf67e
1 changed files with 6 additions and 3 deletions
|
|
@ -196,8 +196,11 @@ def loop(args, recording):
|
|||
|
||||
|
||||
def create_device_quirk(device):
|
||||
quirks = fetch(device, 'quirks')
|
||||
if not quirks:
|
||||
try:
|
||||
quirks = fetch(device, 'quirks')
|
||||
if not quirks:
|
||||
return None
|
||||
except YamlException:
|
||||
return None
|
||||
# Where the device has a quirk, we match on name, vendor and product.
|
||||
# That's the best match we can assemble here from the info we have.
|
||||
|
|
@ -215,7 +218,7 @@ def create_device_quirk(device):
|
|||
def setup_quirks(recording):
|
||||
devices = fetch(recording, 'devices')
|
||||
overrides = None
|
||||
quirks = [create_device_quirk(d) for d in devices if fetch(d, 'quirks')]
|
||||
quirks = [create_device_quirk(d) for d in devices if 'quirks' in d]
|
||||
if not quirks:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue