def full(file1, file2): file1_data = open(file1, 'r', encoding = 'utf-8').readlines() file2_data = open(file2, 'r', encoding = 'utf-8').readlines() utils.cut_slash(file1_data) utils.cut_slash(file2_data) if cmp(file1_data, file2_data) == 0: return True return False
def _read_result_data(name): file_data_temp = open(name, 'r', encoding = 'utf-8').readlines() utils.cut_slash(file_data_temp) file_data = [] push = False for line in file_data_temp: if (push): line = re.sub(r'(.+)Медиана:(\s+)(\S+)', r'\1', line) file_data.append(line) if (line.find('BExpCalcCounter') != -1): push = True return file_data
def _read_trace_data(name): file_data_temp = open(name, 'r', encoding = 'utf-8').readlines() utils.cut_slash(file_data_temp) file_data = [] push = False for line in file_data_temp: if (push): line = re.sub(r'SES\s+(\S+)\s(\S+)\s(\S+)', r'SES \1', line) line = re.sub(r'DPS_TM\s(\S+)(\s+)(\S+)(\s+)(\S+)', r'DPS_TM', line) line = re.sub(r'DPS_ME\s(\S+)(\s+)(\S+)(\s+)(\S+)', r'DPS_ME', line) line = re.sub(r'DPS_MM\s(\S+)', r'DPS_MM', line) file_data.append(line) if (line.find('$Changes') != -1): push = True return file_data