mirror of https://github.com/hrfee/jfa-go
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
548 B
22 lines
548 B
import json
|
|
|
|
with open('config-base.json', 'r') as f:
|
|
config = json.load(f)
|
|
|
|
newconfig = {"order": []}
|
|
|
|
for sect in config:
|
|
newconfig["order"].append(sect)
|
|
newconfig[sect] = {}
|
|
newconfig[sect]["order"] = []
|
|
newconfig[sect]["meta"] = config[sect]["meta"]
|
|
for setting in config[sect]:
|
|
if setting != "meta":
|
|
newconfig[sect]["order"].append(setting)
|
|
newconfig[sect][setting] = config[sect][setting]
|
|
|
|
with open('ordered-config-base.json', 'w') as f:
|
|
f.write(json.dumps(newconfig, indent=4))
|
|
|
|
|