def parse_vowarning(line):
 result = {}
 match = _warning_pat.search(line)
 if match:
  result[u'warning'] = warning = match.group(u'warning')
  if (warning is not None):
   result[u'is_warning'] = (warning[0].upper() == u'W')
   result[u'is_exception'] = (not result[u'is_warning'])
   result[u'number'] = int(match.group(u'warning')[1:])
   result[u'doc_url'] = u'io/votable/api_exceptions.html#{0}'.format(warning.lower())
  else:
   result[u'is_warning'] = False
   result[u'is_exception'] = False
   result[u'is_other'] = True
   result[u'number'] = None
   result[u'doc_url'] = None
  try:
   result[u'nline'] = int(match.group(u'nline'))
  except ValueError:
   result[u'nline'] = 0
  try:
   result[u'nchar'] = int(match.group(u'nchar'))
  except ValueError:
   result[u'nchar'] = 0
  result[u'message'] = match.group(u'rest')
  result[u'is_something'] = True
 else:
  result[u'warning'] = None
  result[u'is_warning'] = False
  result[u'is_exception'] = False
  result[u'is_other'] = False
  result[u'is_something'] = False
  if (not isinstance(line, six.text_type)):
   line = line.decode(u'utf-8')
  result[u'message'] = line
 return result

def parse_vowarning ( line ) : result = { } match = _warning_pat . search ( line ) if match : result [ u'warning' ] = warning = match . group ( u'warning' ) if ( warning is not None ) : result [ u'is_warning' ] = ( warning [ 0 ] . upper ( ) == u'W' ) result [ u'is_exception' ] = ( not result [ u'is_warning' ] ) result [ u'number' ] = int ( match . group ( u'warning' ) [ 1 : ] ) result [ u'doc_url' ] = u'io/votable/api_exceptions.html#{0}' . format ( warning . lower ( ) ) else : result [ u'is_warning' ] = False result [ u'is_exception' ] = False result [ u'is_other' ] = True result [ u'number' ] = None result [ u'doc_url' ] = None try : result [ u'nline' ] = int ( match . group ( u'nline' ) ) except ValueError : result [ u'nline' ] = 0 try : result [ u'nchar' ] = int ( match . group ( u'nchar' ) ) except ValueError : result [ u'nchar' ] = 0 result [ u'message' ] = match . group ( u'rest' ) result [ u'is_something' ] = True else : result [ u'warning' ] = None result [ u'is_warning' ] = False result [ u'is_exception' ] = False result [ u'is_other' ] = False result [ u'is_something' ] = False if ( not isinstance ( line , six . text_type ) ) : line = line . decode ( u'utf-8' ) result [ u'message' ] = line return result
parses the vo warning string back into its parts .