support auto_freeze with auto

This commit is contained in:
2021-01-06 22:20:33 +01:00
parent 8a07892276
commit 1a77416e6d
8 changed files with 24 additions and 6 deletions

View File

@ -15,8 +15,7 @@ FREEZE_AUTOFREEZE_VARIABLE = 'module_instancie'
INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier']
def get_actions_from_condition(condition_name: str,
) -> List[str]:
def get_actions_from_condition(condition_name: str) -> List[str]:
"""get action's name from a condition
"""
if condition_name.startswith('hidden_if_'):
@ -71,7 +70,8 @@ class ConstrainteAnnotator:
del self.objectspace.space.constraints
def convert_auto_freeze(self):
"""convert auto_freeze to continue
"""convert auto_freeze
only if FREEZE_AUTOFREEZE_VARIABLE == 'oui' this variable is frozen
"""
def _convert_auto_freeze(variable, namespace):
if variable.auto_freeze:

View File

@ -109,7 +109,9 @@ class FamilyAnnotator:
variable.mode = family_mode
if variable.hidden is True:
variable.frozen = True
if not variable.auto_save is True and 'force_default_on_freeze' not in vars(variable):
if not variable.auto_save is True and \
not variable.auto_freeze and \
'force_default_on_freeze' not in vars(variable):
variable.force_default_on_freeze = True
def change_variable_mode(self): # pylint: disable=C0111