mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-15 23:00:10 +00:00
Harvey Tindall
eb370d64df
the web ui has been redesigned with the a17t toolkit, which imo looks a lot better than bootstrap. This also brought a complete rework of the web code, which now makes a lot more sense hopefully. the setup page is still stuck with bootstrap, its not much of a priority but i'll rewrite it eventually.
28 lines
926 B
Python
28 lines
926 B
Python
import json, argparse
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("-i", "--input", help="input config base from jf-accounts")
|
|
parser.add_argument("-o", "--output", help="output config base for jfa-go")
|
|
|
|
args = parser.parse_args()
|
|
|
|
with open(args.input, 'r') as f:
|
|
config = json.load(f)
|
|
|
|
newconfig = {"sections": {}, "order": []}
|
|
|
|
for sect in config["sections"]:
|
|
newconfig["order"].append(sect)
|
|
newconfig["sections"][sect] = {}
|
|
newconfig["sections"][sect]["order"] = []
|
|
newconfig["sections"][sect]["meta"] = config["sections"][sect]["meta"]
|
|
newconfig["sections"][sect]["settings"] = {}
|
|
for setting in config["sections"][sect]["settings"]:
|
|
newconfig["sections"][sect]["order"].append(setting)
|
|
newconfig["sections"][sect]["settings"][setting] = config["sections"][sect]["settings"][setting]
|
|
|
|
with open(args.output, 'w') as f:
|
|
f.write(json.dumps(newconfig, indent=4))
|
|
|
|
|