Merge a17t-redesign, kinda ts-ify setup.js
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.
This commit is contained in:
+674
-652
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -9,17 +9,17 @@ args = parser.parse_args()
|
||||
with open(args.input, 'r') as f:
|
||||
config = json.load(f)
|
||||
|
||||
newconfig = {"order": []}
|
||||
newconfig = {"sections": {}, "order": []}
|
||||
|
||||
for sect in config:
|
||||
for sect in config["sections"]:
|
||||
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]
|
||||
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))
|
||||
|
||||
+12
-11
@@ -14,18 +14,19 @@ def generate_ini(base_file, ini_file):
|
||||
|
||||
ini = configparser.RawConfigParser(allow_no_value=True)
|
||||
|
||||
for section in config_base:
|
||||
for section in config_base["sections"]:
|
||||
ini.add_section(section)
|
||||
for entry in config_base[section]:
|
||||
if "description" in config_base[section][entry]:
|
||||
ini.set(section, "; " + config_base[section][entry]["description"])
|
||||
if entry != "meta":
|
||||
value = config_base[section][entry]["value"]
|
||||
if isinstance(value, bool):
|
||||
value = str(value).lower()
|
||||
else:
|
||||
value = str(value)
|
||||
ini.set(section, entry, value)
|
||||
if "meta" in config_base["sections"][section]:
|
||||
ini.set(section, "; " + config_base["sections"][section]["meta"]["description"])
|
||||
for entry in config_base["sections"][section]["settings"]:
|
||||
if "description" in config_base["sections"][section]["settings"][entry]:
|
||||
ini.set(section, "; " + config_base["sections"][section]["settings"][entry]["description"])
|
||||
value = config_base["sections"][section]["settings"][entry]["value"]
|
||||
if isinstance(value, bool):
|
||||
value = str(value).lower()
|
||||
else:
|
||||
value = str(value)
|
||||
ini.set(section, entry, value)
|
||||
|
||||
with open(Path(ini_file), "w") as config_file:
|
||||
ini.write(config_file)
|
||||
|
||||
Reference in New Issue
Block a user