3 Commits

Author SHA1 Message Date
a3e07033e7 fixed stripping spaces for list values 2024-10-02 12:23:20 -04:00
5a3bb026d4 clean up 2024-10-01 21:16:16 -04:00
7aa752c3d3 improved list value handling 2024-10-01 21:14:53 -04:00

View File

@ -82,15 +82,17 @@ class Setting(Tab):
v: Any = ""
if len(value) > 0:
if key in self.keys and "type" in self.keys[key]:
if self.keys[key]["type"] == "list":
v = value[1:-1].split(",")
if self.keys[key]["type"] == "list" and len(value) > 2 and value.strip()[0] == "[" and value.strip()[-1] == "]":
l = value.strip()[1:-1].replace('"', "").replace("'", "").split(",")
v = [v.strip() for v in l]
elif self.keys[key]["type"] == "int":
v = int(value)
else:
v = value
else:
if len(value) > 2 and value.strip()[0] == "[" and value.strip()[-1] == "]":
v = value[1:-1].split(",")
l = value.strip()[1:-1].replace('"', "").replace("'", "").split(",")
v = [v.strip() for v in l]
elif value.isnumeric():
v = int(value)
else: