(input_file, output_file)
| 42 | |
| 43 | |
| 44 | def extract_seconds(input_file, output_file): |
| 45 | with open(input_file, 'r') as f: |
| 46 | lines = f.readlines() |
| 47 | log_created_year = get_log_created_year(input_file) |
| 48 | start_datetime = get_start_time(lines, log_created_year) |
| 49 | assert start_datetime, 'Start time not found' |
| 50 | |
| 51 | out = open(output_file, 'w') |
| 52 | for line in lines: |
| 53 | line = line.strip() |
| 54 | if line.find('Iteration') != -1: |
| 55 | dt = extract_datetime_from_line(line, log_created_year) |
| 56 | elapsed_seconds = (dt - start_datetime).total_seconds() |
| 57 | out.write('%f\n' % elapsed_seconds) |
| 58 | out.close() |
| 59 | |
| 60 | if __name__ == '__main__': |
| 61 | if len(sys.argv) < 3: |
no test coverage detected