diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-11-01 10:59:08 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-11-01 10:59:08 +0100 |
commit | 4c2234e71d85583ca6c7d83cc4856e15778db732 (patch) | |
tree | d42ae4f9898ad0fd434d2a14b7ece527ec4ff1c7 /bin/observations-enum-to-kconfig.py | |
parent | d5d7b960882662d218664ed669fc4dfd034fde33 (diff) |
add enum-to-kconfig exporter (using n/y rather than 0/1)
Diffstat (limited to 'bin/observations-enum-to-kconfig.py')
-rwxr-xr-x | bin/observations-enum-to-kconfig.py | 23 |
1 files changed, 23 insertions, 0 deletions
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() |