feat: doc transitive properties
This commit is contained in:
parent
0024c2cb2a
commit
42053d0e0d
63 changed files with 26 additions and 6 deletions
|
|
@ -39,6 +39,8 @@ HIDDEN_PROPERTIES = [
|
|||
"disabled",
|
||||
]
|
||||
|
||||
DISABLED_PROPERTIES = ["disabled"]
|
||||
|
||||
|
||||
class RougailOutputDoc(Examples, Changelog):
|
||||
"""Rougail Output Doc:
|
||||
|
|
@ -619,9 +621,9 @@ class RougailOutputDoc(Examples, Changelog):
|
|||
elif child.information.get(f"{prop}_calculation", False):
|
||||
annotation = self._to_string(child, prop)
|
||||
if annotation is None or isinstance(annotation, bool):
|
||||
if annotation is None and prop in HIDDEN_PROPERTIES:
|
||||
if (annotation is None and prop in HIDDEN_PROPERTIES) or (annotation is True and prop in DISABLED_PROPERTIES):
|
||||
return False, {}
|
||||
if not annotation:
|
||||
if not annotation or prop in DISABLED_PROPERTIES:
|
||||
continue
|
||||
prop_obj = {
|
||||
"type": "property",
|
||||
|
|
@ -851,20 +853,26 @@ class RougailOutputDoc(Examples, Changelog):
|
|||
description = self._convert_description(option.description(uncalculated=True), "description", its_a_path=False)
|
||||
variables = [[variable_path, description, None]]
|
||||
for cpath, description, identifiers in variables:
|
||||
if not cpath:
|
||||
if calculation["propertyerror"] == "transitive":
|
||||
if not cpath:
|
||||
return True
|
||||
else:
|
||||
print(variable_path)
|
||||
continue
|
||||
pass
|
||||
elif not cpath:
|
||||
# we cannot access to this variable so try with permissive
|
||||
variable = self.true_config.forcepermissive.option(variable_path)
|
||||
try:
|
||||
variable_value = self._get_unmodified_default_value(variable)
|
||||
except PropertiesOptionError as err:
|
||||
if calculation["propertyerror"]:
|
||||
if calculation["propertyerror"] is True:
|
||||
raise err from err
|
||||
variable_value = value
|
||||
except VariableCalculationDependencyError:
|
||||
values.append(_("depends on an undocumented variable"))
|
||||
continue
|
||||
except AttributeError as err:
|
||||
# if err.code != "option-not-found" or not calculation.get("optional", False):
|
||||
# raise err from err
|
||||
return calculation.get("default", False)
|
||||
if (
|
||||
condition == "when"
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
Loading…
Reference in a new issue