From 4c2234e71d85583ca6c7d83cc4856e15778db732 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 1 Nov 2022 10:59:08 +0100 Subject: add enum-to-kconfig exporter (using n/y rather than 0/1) --- bin/observations-enum-to-kconfig.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/observations-enum-to-kconfig.py (limited to 'bin/observations-enum-to-kconfig.py') diff --git a/bin/observations-enum-to-kconfig.py b/bin/observations-enum-to-kconfig.py new file mode 100755 index 0000000..7462382 --- /dev/null +++ b/bin/observations-enum-to-kconfig.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import dfatool.utils +import json +import lzma +import sys + + +def main(): + infile = sys.argv[1] + outfile = sys.argv[2] + + with lzma.open(infile, "rt") as f: + observations = json.load(f) + + dfatool.utils.observations_enum_to_bool(observations, kconfig=True) + + with lzma.open(outfile, "wt") as f: + json.dump(observations, f) + + +if __name__ == "__main__": + main() -- cgit v1.2.3