diff options
Diffstat (limited to 'src/tools/vppapigen/vppapigen_crc.py')
-rw-r--r-- | src/tools/vppapigen/vppapigen_crc.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/tools/vppapigen/vppapigen_crc.py b/src/tools/vppapigen/vppapigen_crc.py index 791e347292e..525f6c07efc 100644 --- a/src/tools/vppapigen/vppapigen_crc.py +++ b/src/tools/vppapigen/vppapigen_crc.py @@ -12,11 +12,10 @@ def run(args, input_filename, s): major = 0 minor = 0 patch = 0 - if 'version' in s['Option']: - v = s['Option']['version'] - (major, minor, patch) = v.split('.') - j['_version'] = {'major': major, 'minor': minor, 'patch': patch} - for t in s['Define']: - j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major, - 'options': t.options} - return json.dumps(j, indent=4, separators=(',', ': ')) + if "version" in s["Option"]: + v = s["Option"]["version"] + (major, minor, patch) = v.split(".") + j["_version"] = {"major": major, "minor": minor, "patch": patch} + for t in s["Define"]: + j[t.name] = {"crc": f"{t.crc:#08x}", "version": major, "options": t.options} + return json.dumps(j, indent=4, separators=(",", ": ")) |