def get_value ( self , context ) : if self . value : return expressions . eval_string ( self . value , context ) else : # Empty input raises cryptic EOF syntax err, this more human # friendly raise ValueError ( '!py string expression is empty. It must be a ' 'valid python expression instead.' )
evaluate a user entered expression in python
Run python eval on the input string .
def get_value(self, context):
        """Run python eval on the input string."""
        if self.value:
            return expressions.eval_string(self.value, context)
        else:
            # Empty input raises cryptic EOF syntax err, this more human
            # friendly
            raise ValueError('!py string expression is empty. It must be a '
                             'valid python expression instead.')