From 3814799ba6321d38057221d7d032461545ce24e5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 8 Oct 2021 15:38:00 +0200 Subject: Add model output for kconfig-webconf --- bin/analyze-kconfig.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bin/analyze-kconfig.py') 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) -- cgit v1.2.3