def delete(ename): """ Deletes the expression with given name if it exists. """ if exists(ename): try: visit.DeleteExpression(ename) except: # must be a database expression pass
def clear(): """ Deletes all existing expressions. """ expr_names = [expr[0] for expr in visit.Expressions()] for ename in expr_names: try: visit.DeleteExpression(ename) except: # must be a database expression pass