some adaptation for tiramisu-web
This commit is contained in:
@ -175,5 +175,5 @@ class MasterSlaves(OptionDescription):
|
||||
raise SlaveError(_('cannot reduce length of the master "{}"'
|
||||
'').format(option.impl_get_display_name()))
|
||||
|
||||
def is_masterslaves(self):
|
||||
def impl_is_master_slaves(self):
|
||||
return True
|
||||
|
@ -484,7 +484,7 @@ class Option(OnlyOption):
|
||||
consistencies = descr._cache_consistencies.get(option)
|
||||
else:
|
||||
# is no context, get consistencies in option
|
||||
consistencies = option._get_consistencies()
|
||||
consistencies = option.get_consistencies()
|
||||
if consistencies is not None:
|
||||
for cons_id, func, all_cons_opts, params in consistencies:
|
||||
warnings_only = params.get('warnings_only', False)
|
||||
@ -759,7 +759,7 @@ class Option(OnlyOption):
|
||||
def _del_consistency(self):
|
||||
self._consistencies.pop(-1)
|
||||
|
||||
def _get_consistencies(self):
|
||||
def get_consistencies(self):
|
||||
return getattr(self, '_consistencies', STATIC_TUPLE)
|
||||
|
||||
def _has_consistencies(self, context):
|
||||
|
@ -76,7 +76,7 @@ class CacheOptionDescription(BaseOption):
|
||||
is_multi = option.impl_is_multi()
|
||||
if not option.impl_is_symlinkoption() and 'force_store_value' in option.impl_getproperties():
|
||||
force_store_values.append((subpath, option))
|
||||
for cons_id, func, all_cons_opts, params in option._get_consistencies():
|
||||
for cons_id, func, all_cons_opts, params in option.get_consistencies():
|
||||
option._valid_consistencies(all_cons_opts[1:], init=False)
|
||||
if func not in ALLOWED_CONST_LIST and is_multi:
|
||||
is_masterslaves = option.impl_is_master_slaves()
|
||||
@ -473,7 +473,7 @@ class OptionDescription(OptionDescriptionWalk):
|
||||
# the group_type is useful for filtering OptionDescriptions in a config
|
||||
self._group_type = groups.default
|
||||
|
||||
def is_masterslaves(self):
|
||||
def impl_is_master_slaves(self):
|
||||
return False
|
||||
|
||||
def impl_getdoc(self):
|
||||
|
@ -42,7 +42,8 @@ class SymLinkOption(OnlyOption):
|
||||
name):
|
||||
return getattr(self._opt, name)
|
||||
|
||||
def impl_has_dependency(self, self_is_dep=True):
|
||||
def impl_has_dependency(self,
|
||||
self_is_dep=True):
|
||||
"""If self_is_dep is True, it has dependency (self._opt), so return True
|
||||
if self_is_dep is False, cannot has validation or callback, so return False
|
||||
"""
|
||||
@ -78,10 +79,11 @@ class SymLinkOption(OnlyOption):
|
||||
#def _is_subdyn(self):
|
||||
# return getattr(self._opt, '_subdyn', None) is not None
|
||||
|
||||
def _get_consistencies(self):
|
||||
def get_consistencies(self):
|
||||
return ()
|
||||
|
||||
def _has_consistencies(self, context):
|
||||
def _has_consistencies(self,
|
||||
context):
|
||||
return option._opt._has_consistencies(context)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user