diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-09-30 15:24:06 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-09-30 15:24:06 +0200 |
commit | 03f4400a5c11d1567524a20d8d033d0ea3ad8f03 (patch) | |
tree | 1b5032cdc5bd41434126a98440ea68d7efb288e7 /lib | |
parent | 0cde8b64d756a522d95c0826ddfcb43c98d3726b (diff) |
KConfigModel: Export kconfig hash
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model.py | 5 |
1 files changed, 5 insertions, 0 deletions
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, |