summaryrefslogtreecommitdiff
path: root/bin/observations-enum-to-kconfig.py
blob: 746238218e6765633dbd10f91e130169030791b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()