WIP: Expand the developer documentation #27
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,15 +64,18 @@ class Walker:
|
||||||
main_structures: Optional[List[str]] = None,
|
main_structures: Optional[List[str]] = None,
|
||||||
isolated_namespace: bool = True,
|
isolated_namespace: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
directory_dict = chain(
|
if not main_namespace:
|
||||||
(
|
directory_dict = extra_structures.items()
|
||||||
|
else:
|
||||||
|
directory_dict = chain(
|
||||||
(
|
(
|
||||||
main_namespace,
|
(
|
||||||
main_structures,
|
main_namespace,
|
||||||
|
main_structures,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
extra_structures.items(),
|
||||||
extra_structures.items(),
|
)
|
||||||
)
|
|
||||||
for namespace, directories in directory_dict:
|
for namespace, directories in directory_dict:
|
||||||
self.convert.create_namespace(namespace, isolated_namespace)
|
self.convert.create_namespace(namespace, isolated_namespace)
|
||||||
for filename in self.get_sorted_filenames(directories):
|
for filename in self.get_sorted_filenames(directories):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue