diff options
author | Elliott Hughes <enh@google.com> | 2016-06-29 14:12:29 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-06-29 14:12:29 -0700 |
commit | b22b9987a88f524986c5e40323bfbbb3bb943290 (patch) | |
tree | d0f97ed51d03aef11118e4a939aa14c28f0c3d6c /toolbox/generate-input.h-labels.py | |
parent | 54c121962bdf68c7c66724159260c926ce58e351 (diff) | |
download | core-b22b9987a88f524986c5e40323bfbbb3bb943290.tar.gz core-b22b9987a88f524986c5e40323bfbbb3bb943290.tar.bz2 core-b22b9987a88f524986c5e40323bfbbb3bb943290.zip |
Fix the generated getevent labels.
Some of the less-used stuff stayed behind in input.h, so we need to
parse both files.
Change-Id: Iff2b6e3fc4f5a6584169d12f16427b4f235da21a
Test: manual inspection of the generated file.
Diffstat (limited to 'toolbox/generate-input.h-labels.py')
-rwxr-xr-x | toolbox/generate-input.h-labels.py | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/toolbox/generate-input.h-labels.py b/toolbox/generate-input.h-labels.py index a2b911165..c0e9fce6e 100755 --- a/toolbox/generate-input.h-labels.py +++ b/toolbox/generate-input.h-labels.py @@ -38,39 +38,40 @@ ff_list = [] r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)') -with open(sys.argv[1], 'r') as f: - for line in f: - m = r.match(line) - if m: - name = m.group(1) - if name.startswith("INPUT_PROP_"): - input_prop_list.append(name) - elif name.startswith("EV_"): - ev_list.append(name) - elif name.startswith("SYN_"): - syn_list.append(name) - elif name.startswith("KEY_") or name.startswith("BTN_"): - key_list.append(name) - elif name.startswith("REL_"): - rel_list.append(name) - elif name.startswith("ABS_"): - abs_list.append(name) - elif name.startswith("SW_"): - sw_list.append(name) - elif name.startswith("MSC_"): - msc_list.append(name) - elif name.startswith("LED_"): - led_list.append(name) - elif name.startswith("REP_"): - rep_list.append(name) - elif name.startswith("SND_"): - snd_list.append(name) - elif name.startswith("MT_TOOL_"): - mt_tool_list.append(name) - elif name.startswith("FF_STATUS_"): - ff_status_list.append(name) - elif name.startswith("FF_"): - ff_list.append(name) +for arg in sys.argv[1:]: + with open(arg, 'r') as f: + for line in f: + m = r.match(line) + if m: + name = m.group(1) + if name.startswith("INPUT_PROP_"): + input_prop_list.append(name) + elif name.startswith("EV_"): + ev_list.append(name) + elif name.startswith("SYN_"): + syn_list.append(name) + elif name.startswith("KEY_") or name.startswith("BTN_"): + key_list.append(name) + elif name.startswith("REL_"): + rel_list.append(name) + elif name.startswith("ABS_"): + abs_list.append(name) + elif name.startswith("SW_"): + sw_list.append(name) + elif name.startswith("MSC_"): + msc_list.append(name) + elif name.startswith("LED_"): + led_list.append(name) + elif name.startswith("REP_"): + rep_list.append(name) + elif name.startswith("SND_"): + snd_list.append(name) + elif name.startswith("MT_TOOL_"): + mt_tool_list.append(name) + elif name.startswith("FF_STATUS_"): + ff_status_list.append(name) + elif name.startswith("FF_"): + ff_list.append(name) def Dump(struct_name, values): print('static struct label %s[] = {' % (struct_name)) |