Add ParamInformation and callback can be a coroutine

This commit is contained in:
2020-10-03 14:29:15 +02:00
parent afeedc1db6
commit 6910371779
8 changed files with 154 additions and 42 deletions

View File

@ -30,7 +30,9 @@ from ..error import ConfigError, ConflictError
class CacheOptionDescription(BaseOption):
__slots__ = ('_cache_force_store_values',)
__slots__ = ('_cache_force_store_values',
'_cache_dependencies_information',
)
def impl_already_build_caches(self) -> bool:
return self.impl_is_readonly()
@ -42,7 +44,9 @@ class CacheOptionDescription(BaseOption):
currpath: List[str]=None,
cache_option=None,
force_store_values=None,
display_name=None) -> None:
dependencies_information=None,
display_name=None,
) -> None:
"""validate options and set option has readonly option
"""
# _consistencies is None only when we start to build cache
@ -52,6 +56,7 @@ class CacheOptionDescription(BaseOption):
if __debug__:
cache_option = []
force_store_values = []
dependencies_information = {}
currpath = []
else:
init = False
@ -73,8 +78,11 @@ class CacheOptionDescription(BaseOption):
sub_currpath,
cache_option,
force_store_values,
dependencies_information,
display_name)
else:
for information in option.get_dependencies_information():
dependencies_information.setdefault(information, []).append(option)
is_multi = option.impl_is_multi()
if not option.impl_is_symlinkoption():
properties = option.impl_getproperties()
@ -102,6 +110,7 @@ class CacheOptionDescription(BaseOption):
option._set_readonly()
if init:
self._cache_force_store_values = force_store_values
self._cache_dependencies_information = dependencies_information
self._path = self._name
self._set_readonly()