(self, variable_definition, value)
Set variable value in current context

        Args:
            variable_definition (:class:`business_logic.models.VariableDefinition`): definition of variable
            value: variable value
Set variable value in current context
Set variable value in current context
def set_variable(self, variable_definition, value):
        """
        Set variable value in current context

        Args:
            variable_definition (:class:`business_logic.models.VariableDefinition`): definition of variable
            value: variable value

        """
        assert isinstance(variable_definition, VariableDefinition)

        if variable_definition.name.find('.') == -1:
            self._vars[variable_definition.name] = value
            return

        attrs = variable_definition.name.split('.')
        current = self._vars[attrs[0]]

        for attr in attrs[1:-1]:
            current = getattr(current, attr)

        setattr(current, attrs[-1], None if isinstance(value, Variable.Undefined) else value)
def set_variable ( self , variable_definition , value ) : assert isinstance ( variable_definition , VariableDefinition ) if variable_definition . name . find ( '.' ) == - 1 : self . _vars [ variable_definition . name ] = value return attrs = variable_definition . name . split ( '.' ) current = self . _vars [ attrs [ 0 ] ] for attr in attrs [ 1 : - 1 ] : current = getattr ( current , attr ) setattr ( current , attrs [ - 1 ] , None if isinstance ( value , Variable . Undefined ) else value )