i_set_the_prop_property_to_value - don't fail silently on incorrect bool values

This commit is contained in:
Andrej730
2025-11-10 15:53:24 +05:00
parent e1bf891ec6
commit 19bdd3e622
+4
View File
@@ -549,6 +549,8 @@ def i_set_the_prop_property_to_value(prop: str, value: str):
"""
:param prop: Could be either property name, property text, property icon
or property index (e.g. "1st", "2nd", "5th").
:param value:
For boolean propeties - 'TRUE' or 'FALSE'.
"""
value = value.strip()
assert panel_spy
@@ -566,6 +568,8 @@ def i_set_the_prop_property_to_value(prop: str, value: str):
setattr(spied_prop["props"], spied_prop["name"], True)
elif value == "FALSE":
setattr(spied_prop["props"], spied_prop["name"], False)
else:
assert False, f"Unexpected value for BOOLEAN property: '{value}'. Allowed values: TRUE, FALSE."
elif spied_prop["prop_type"] == "FLOAT":
setattr(spied_prop["props"], spied_prop["name"], float(value))
elif spied_prop["prop_type"] == "INT":