forked from Shinonome/dots-hyprland
agsconfigurator: fix stupid parse bool into string
This commit is contained in:
@@ -8,9 +8,9 @@ import re
|
|||||||
def parse_value(value):
|
def parse_value(value):
|
||||||
"""Parse the value into its appropriate Python type (e.g., bool, int, float, list, dict, or string)."""
|
"""Parse the value into its appropriate Python type (e.g., bool, int, float, list, dict, or string)."""
|
||||||
try:
|
try:
|
||||||
return ast.literal_eval(value)
|
return json.loads(value)
|
||||||
except (ValueError, SyntaxError):
|
except json.JSONDecodeError: # Fallback to string if parsing fails
|
||||||
return value # Fallback to string if parsing fails
|
return value
|
||||||
|
|
||||||
def remove_trailing_commas(json_string):
|
def remove_trailing_commas(json_string):
|
||||||
"""Remove trailing commas from JSON-like structures."""
|
"""Remove trailing commas from JSON-like structures."""
|
||||||
|
|||||||
Reference in New Issue
Block a user