fix: allow no user_datas installation (for example to generate doc)
This commit is contained in:
parent
2654141002
commit
7f9d6f17d7
3 changed files with 6 additions and 6 deletions
src/rougail
|
@ -178,7 +178,10 @@ class ParserVariable:
|
||||||
"structural_commandline.add_extra_options"
|
"structural_commandline.add_extra_options"
|
||||||
]
|
]
|
||||||
self.structurals = rougailconfig["step.structural"]
|
self.structurals = rougailconfig["step.structural"]
|
||||||
self.user_datas = rougailconfig["step.user_data"]
|
try:
|
||||||
|
self.user_datas = rougailconfig["step.user_data"]
|
||||||
|
except:
|
||||||
|
self.user_datas = []
|
||||||
try:
|
try:
|
||||||
self.output = rougailconfig["step.output"]
|
self.output = rougailconfig["step.output"]
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -452,7 +452,7 @@ class _VariableCalculation(Calculation):
|
||||||
)
|
)
|
||||||
if variable and not isinstance(variable, objectspace.variable):
|
if variable and not isinstance(variable, objectspace.variable):
|
||||||
if isinstance(variable, objectspace.family):
|
if isinstance(variable, objectspace.family):
|
||||||
msg = f'the variable "{variable.path}" is in fact a family in attribute "{self.attribute_name}" for "{self.path}"'
|
msg = f'a variable "{variable.path}" is needs in attribute "{self.attribute_name}" for "{self.path}" but it\'s a family'
|
||||||
raise DictConsistencyError(msg, 47, self.xmlfiles)
|
raise DictConsistencyError(msg, 47, self.xmlfiles)
|
||||||
else:
|
else:
|
||||||
msg = f'unknown object "{variable}" in attribute "{self.attribute_name}" for "{self.path}"'
|
msg = f'unknown object "{variable}" in attribute "{self.attribute_name}" for "{self.path}"'
|
||||||
|
|
|
@ -74,7 +74,6 @@ class Paths:
|
||||||
def get_with_dynamic(
|
def get_with_dynamic(
|
||||||
self,
|
self,
|
||||||
path: str,
|
path: str,
|
||||||
# identifier_path: str,
|
|
||||||
current_path: str,
|
current_path: str,
|
||||||
version: str,
|
version: str,
|
||||||
namespace: str,
|
namespace: str,
|
||||||
|
@ -145,9 +144,7 @@ class Paths:
|
||||||
if "{{ suffix }}" in path:
|
if "{{ suffix }}" in path:
|
||||||
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
elif not path in self._data:
|
elif not path in self._data:
|
||||||
current_path = None
|
new_path = parent_path = current_path = None
|
||||||
parent_path = None
|
|
||||||
new_path = current_path
|
|
||||||
identifiers = []
|
identifiers = []
|
||||||
for name in path.split("."):
|
for name in path.split("."):
|
||||||
if current_path:
|
if current_path:
|
||||||
|
|
Loading…
Reference in a new issue