summaryrefslogtreecommitdiff
path: root/libevdev
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-06-18 14:45:07 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-07-09 11:57:57 +1000
commit812fc7096dd6e71e955d50a01c8fd0da92e66fab (patch)
treef0727271022a5beb0ac1d42299d90a24272ff68f /libevdev
parent35d6ce09d8134340e75a2f4301b8ce74f29ba73a (diff)
downloadlibevdev-812fc7096dd6e71e955d50a01c8fd0da92e66fab.tar.gz
make-event-names: minor cleanups for readability
Two variable renames for less ambiguity Two changes from an long if condition to a "if foo in [...]" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Diffstat (limited to 'libevdev')
-rwxr-xr-xlibevdev/make-event-names.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/libevdev/make-event-names.py b/libevdev/make-event-names.py
index 44e1685..faee720 100755
--- a/libevdev/make-event-names.py
+++ b/libevdev/make-event-names.py
@@ -27,7 +27,7 @@ prefixes = [
"INPUT_PROP_",
]
-blacklist = [
+duplicates = [
"EV_VERSION",
"BTN_MISC",
"BTN_MOUSE",
@@ -47,7 +47,7 @@ btn_additional = [
[0, "BTN_Y"],
]
-names = [
+code_prefixes = [
"REL_",
"ABS_",
"KEY_",
@@ -77,7 +77,7 @@ def print_map(bits):
print("static const char * const * const event_type_map[EV_MAX + 1] = {")
for prefix in prefixes:
- if prefix == "BTN_" or prefix == "EV_" or prefix == "INPUT_PROP_":
+ if prefix in ["BTN_", "EV_", "INPUT_PROP_"]:
continue
print(" [EV_%s] = %s_map," % (prefix[:-1], prefix[:-1].lower()))
@@ -94,7 +94,7 @@ def print_map(bits):
print("static const int ev_max[EV_MAX + 1] = {")
print(" [0 ... EV_MAX] = -1,")
for prefix in prefixes:
- if prefix == "BTN_" or prefix == "EV_" or prefix == "INPUT_PROP_":
+ if prefix in ["BTN_", "EV_", "INPUT_PROP_"]:
continue
print(" [EV_%s] = %s_MAX," % (prefix[:-1], prefix[:-1]))
print("};")
@@ -128,7 +128,7 @@ def print_lookup_table(bits):
print("")
print("static const struct name_entry code_names[] = {")
- for prefix in sorted(names, key=lambda e: e):
+ for prefix in sorted(code_prefixes, key=lambda e: e):
print_lookup(bits, prefix[:-1].lower())
print("};")
print("")
@@ -161,7 +161,7 @@ def parse_define(bits, line):
name = m.group(1)
- if name in blacklist:
+ if name in duplicates:
return
try: