mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-04 17:30:11 +00:00
Harvey Tindall
024c0b56aa
Python utility included to convert config-base.json into a new version which includes lists that define the order settings should be displayed. admin.js edited to recognize this.
22 lines
548 B
Python
22 lines
548 B
Python
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))
|
|
|
|
|