diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-10-08 15:38:00 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-10-08 15:38:00 +0200 |
commit | 3814799ba6321d38057221d7d032461545ce24e5 (patch) | |
tree | 087067826bd1971feefa1d94f0bd4b651b28b6e3 /bin/analyze-kconfig.py | |
parent | aa620d777c7fa4d09eea45a1cf18c64c9716af8f (diff) |
Add model output for kconfig-webconf
Diffstat (limited to 'bin/analyze-kconfig.py')
-rwxr-xr-x | bin/analyze-kconfig.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py index 6887489..dc6d187 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -137,8 +137,20 @@ def main(): print("TODO") if args.export_tree: + complete_json_model = model.to_json( + with_param_name=True, param_names=parameter_names + ) + json_model = dict() + for name, attribute_data in complete_json_model["name"].items(): + for attribue, data in attribute_data.items(): + # data.update({ + # "unit": "", + # "description": attribute, + # "minimize": True + # }) + json_model[attribute] = data with open(args.export_tree, "w") as f: - json.dump(model.to_json(), f, sort_keys=True, cls=dfatool.utils.NpEncoder) + json.dump(json_model, f, sort_keys=True, cls=dfatool.utils.NpEncoder) if args.config: kconf = kconfiglib.Kconfig(args.kconfig_path) |