agsconfigurator: fix stupid parse bool into string

This commit is contained in:
end-4
2025-04-07 21:02:33 +02:00
parent 15db586178
commit 699efba508
+3 -3
View File
@@ -8,9 +8,9 @@ import re
def parse_value(value):
"""Parse the value into its appropriate Python type (e.g., bool, int, float, list, dict, or string)."""
try:
return ast.literal_eval(value)
except (ValueError, SyntaxError):
return value # Fallback to string if parsing fails
return json.loads(value)
except json.JSONDecodeError: # Fallback to string if parsing fails
return value
def remove_trailing_commas(json_string):
"""Remove trailing commas from JSON-like structures."""