From 03f4400a5c11d1567524a20d8d033d0ea3ad8f03 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 30 Sep 2020 15:24:06 +0200 Subject: KConfigModel: Export kconfig hash --- lib/model.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/model.py') diff --git a/lib/model.py b/lib/model.py index a75033c..7298fc4 100644 --- a/lib/model.py +++ b/lib/model.py @@ -1313,6 +1313,7 @@ class KConfigModel: self.data = list() for i in indices: self.data.append(kconfig_benchmark.data[i]) + self.kconfig_hash = kconfig_benchmark.kconfig_hash self.symbols = kconfig_benchmark.symbol_names self.choices = kconfig_benchmark.choice_names self.symbol = kconfig_benchmark.symbol @@ -1335,7 +1336,9 @@ class KConfigModel: @classmethod def from_json(cls, json_input: dict): self = cls() + assert json_input["model_type"] == "kconfig-dtree" self.attribute = json_input["attribute"] + self.kconfig_hash = json_input["kconfig_hash"] self.symbols = json_input["symbols"] self.choices = json_input["choices"] self.model = self._node_from_json(json_input["model"]) @@ -1380,6 +1383,8 @@ class KConfigModel: def to_json(self): output = { "model": self.model.to_json(), + "model_type": "kconfig-dtree", + "kconfig_hash": self.kconfig_hash, "symbols": self.symbols, "choices": self.choices, "attribute": self.attribute, -- cgit v1.2.3