def parse_grep_line(line):
 try:
  (filename, line_number, contents) = line.split(u':', 2)
  result = (filename, line_number, contents)
 except ValueError:
  result = None
 return result

def parse_grep_line ( line ) : try : ( filename , line_number , contents ) = line . split ( u':' , 2 ) result = ( filename , line_number , contents ) except ValueError : result = None return result
parse a grep result line into .