def get_info_file(filename):
 data = ''
 errors = re.compile('\\b(error|fail|failed)\\b', re.IGNORECASE)
 if os.path.isfile(filename):
  f = open(('%s' % filename), 'r')
  lines = f.readlines()
  f.close()
  rx = re.compile('(\'|")')
  for line in lines:
   new_line = rx.sub('', line)
   errors_found = errors.findall(new_line)
   if (len(errors_found) > 0):
    data += ('<font color=red>%s</font><br>' % str(new_line))
   else:
    data += ('%s<br>' % str(new_line))
  if (not data):
   data = 'No Information Found.<br>'
 else:
  data = 'File not found.<br>'
 return data

def get_info_file ( filename ) : data = '' errors = re . compile ( '\\b(error|fail|failed)\\b' , re . IGNORECASE ) if os . path . isfile ( filename ) : f = open ( ( '%s' % filename ) , 'r' ) lines = f . readlines ( ) f . close ( ) rx = re . compile ( '(\'|")' ) for line in lines : new_line = rx . sub ( '' , line ) errors_found = errors . findall ( new_line ) if ( len ( errors_found ) > 0 ) : data += ( '<font color=red>%s</font><br>' % str ( new_line ) ) else : data += ( '%s<br>' % str ( new_line ) ) if ( not data ) : data = 'No Information Found.<br>' else : data = 'File not found.<br>' return data
gets the contents of an autotest info file .