def _parse_check(rule):
 if (rule == '!'):
  return FalseCheck()
 elif (rule == '@'):
  return TrueCheck()
 try:
  (kind, match) = rule.split(':', 1)
 except Exception:
  LOG.exception((_('Failed to understand rule %(rule)s') % locals()))
  return FalseCheck()
 if (kind in _checks):
  return _checks[kind](kind, match)
 elif (None in _checks):
  return _checks[None](kind, match)
 else:
  LOG.error((_('No handler for matches of kind %s') % kind))
  return FalseCheck()

def _parse_check ( rule ) : if ( rule == '!' ) : return FalseCheck ( ) elif ( rule == '@' ) : return TrueCheck ( ) try : ( kind , match ) = rule . split ( ':' , 1 ) except Exception : LOG . exception ( ( _ ( 'Failed to understand rule %(rule)s' ) % locals ( ) ) ) return FalseCheck ( ) if ( kind in _checks ) : return _checks [ kind ] ( kind , match ) elif ( None in _checks ) : return _checks [ None ] ( kind , match ) else : LOG . error ( ( _ ( 'No handler for matches of kind %s' ) % kind ) ) return FalseCheck ( )
parse a single base check rule into an appropriate check object .