summaryrefslogtreecommitdiffstats
path: root/hwdb/parse_hwdb.py
diff options
context:
space:
mode:
authorLuís Ferreira <contact@lsferreira.net>2019-04-13 20:12:51 +0200
committerLuís Ferreira <contact@lsferreira.net>2019-04-27 23:12:08 +0200
commitccf478417455ab1191571923fa640363d4c4b7a6 (patch)
tree341bff0a1d01422bb1d8d3013e96fafb5cb28ede /hwdb/parse_hwdb.py
parenthwdb: add ACCEL_LOCATION to the allowed properties (diff)
downloadsystemd-ccf478417455ab1191571923fa640363d4c4b7a6.tar.xz
systemd-ccf478417455ab1191571923fa640363d4c4b7a6.zip
hwdb: add ACCEL_LOCATION property to parse_hwdb.py
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Diffstat (limited to 'hwdb/parse_hwdb.py')
-rwxr-xr-xhwdb/parse_hwdb.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py
index d84fba2221..fcc9a65e2b 100755
--- a/hwdb/parse_hwdb.py
+++ b/hwdb/parse_hwdb.py
@@ -126,6 +126,7 @@ def property_grammar():
('KEYBOARD_LED_NUMLOCK', Literal('0')),
('KEYBOARD_LED_CAPSLOCK', Literal('0')),
('ACCEL_MOUNT_MATRIX', mount_matrix),
+ ('ACCEL_LOCATION', STRING),
)
fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
for name, val in props]
@@ -177,6 +178,10 @@ def check_one_default(prop, settings):
if len(defaults) > 1:
error('More than one star entry: {!r}', prop)
+def check_one_accel_location(prop, value):
+ if value not in ['base', 'display']:
+ error('Wrong accel location: {!r}', prop)
+
def check_one_mount_matrix(prop, value):
numbers = [s for s in value if s not in {';', ','}]
if len(numbers) != 9:
@@ -219,6 +224,8 @@ def check_properties(groups):
check_one_default(prop, parsed.VALUE.SETTINGS)
elif parsed.NAME == 'ACCEL_MOUNT_MATRIX':
check_one_mount_matrix(prop, parsed.VALUE)
+ elif parsed.NAME == 'ACCEL_LOCATION':
+ check_one_accel_location(prop, parsed.VALUE)
elif parsed.NAME.startswith('KEYBOARD_KEY_'):
check_one_keycode(prop, parsed.VALUE)