def expression_ok(expression):
 expression_ok = True
 fields = expression.split()
 for f in fields:
  try:
   if f.endswith(':2'):
    f = f[:(-2)]
   if (mavutil.evaluate_expression(f, mestate.status.msgs) is None):
    expression_ok = False
  except Exception:
   expression_ok = False
   break
 return expression_ok

def expression_ok ( expression ) : expression_ok = True fields = expression . split ( ) for f in fields : try : if f . endswith ( ':2' ) : f = f [ : ( - 2 ) ] if ( mavutil . evaluate_expression ( f , mestate . status . msgs ) is None ) : expression_ok = False except Exception : expression_ok = False break return expression_ok
return true if an expression is ok with current messages .