fix: main_namespace is not mandatory (for example for risotto)
This commit is contained in:
parent
66e6ddfe31
commit
a749d66d6e
2 changed files with 18 additions and 7 deletions
|
|
@ -37,6 +37,7 @@ from .object_model import (
|
||||||
)
|
)
|
||||||
from ..i18n import _
|
from ..i18n import _
|
||||||
from ..error import DictConsistencyError
|
from ..error import DictConsistencyError
|
||||||
|
from ..tiramisu import CONVERT_OPTION
|
||||||
|
|
||||||
|
|
||||||
class CollectFamily:
|
class CollectFamily:
|
||||||
|
|
@ -197,7 +198,14 @@ class CollectVariable:
|
||||||
)
|
)
|
||||||
new_params = []
|
new_params = []
|
||||||
namespace = self.objectspace.namespace
|
namespace = self.objectspace.namespace
|
||||||
|
params_data = list(CONVERT_OPTION.get(self.user_type, {}).get("params", {}))
|
||||||
for key, val in params.items():
|
for key, val in params.items():
|
||||||
|
if params_data and key not in params_data:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_('params "{0}" is not a known parameters with type "{1}" for "{2}" (the list of possible parameters is {3})').format(key, self.user_type, self.path, display_list(params_data, add_quote=True)),
|
||||||
|
92,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
new_params.append(
|
new_params.append(
|
||||||
AnyParam(
|
AnyParam(
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,9 @@ class Walker:
|
||||||
main_structures: Optional[List[str]] = None,
|
main_structures: Optional[List[str]] = None,
|
||||||
isolated_namespace: bool = True,
|
isolated_namespace: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
if not main_namespace:
|
||||||
|
directory_dict = extra_structures.items()
|
||||||
|
else:
|
||||||
directory_dict = chain(
|
directory_dict = chain(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue