tools: handle empty files in the test-svg tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cdb7f905ca
commit
06aa5b05b1
|
@ -49,6 +49,10 @@ def parse_file(filename, tablet_model, orientation):
|
|||
stem = Path(filename).stem
|
||||
with open(filename) as fd:
|
||||
yml = yaml.load(fd, Loader=yaml.Loader)
|
||||
if not yml:
|
||||
print(f'{filename}: empty file.')
|
||||
return
|
||||
|
||||
# all recv lists that have source PEN
|
||||
pendata = [d['recv'] for d in yml['data'] if 'recv' in d and 'source' in d and d['source'] == 'PEN']
|
||||
data = list(flatten(pendata))
|
||||
|
|
Loading…
Reference in New Issue