Quick definition of an optional parameter variable #24

Merged
egarette merged 8 commits from optional_parameter_in_variable into develop 2024-09-04 17:30:38 +02:00
Showing only changes of commit 1570101088 - Show all commits

View file

@ -478,9 +478,13 @@ class Variable(Common):
keys["default"] = self.populate_calculation(self.elt.default)
except VariableCalculationDependencyError:
pass
for attribute in ['frozen', 'hidden', "mandatory", "disabled"]:
if hasattr(self.elt, attribute):
raise DictConsistencyError(f"Sub-attributes not allowed in a '{attribute}' attribute", 100, self.elt.xmlfiles)
for attribute in ["frozen", "hidden", "mandatory", "disabled"]:
if hasattr(self.elt, attribute): # FIXME FIXME and attribute == "optional":
raise DictConsistencyError(
f"Sub-attributes not allowed in a '{attribute}' attribute",
100,
self.elt.xmlfiles,
)
if self.elt.path in self.objectspace.default_multi:
try:
keys["default_multi"] = self.populate_calculation(