|
25 | 25 | parser.print_help() |
26 | 26 | sys.exit(1) |
27 | 27 |
|
| 28 | + |
28 | 29 | def print_log_dir_times(logdir): |
29 | 30 | first = True |
30 | 31 | totalElapsed = 0 |
@@ -55,24 +56,28 @@ def print_log_dir_times(logdir): |
55 | 56 | elapsedTime = int(timeList[0])*60 + int(timeList[1]) |
56 | 57 | elif len(timeList) == 3: |
57 | 58 | # Hours, minutes, and seconds are present |
58 | | - elapsedTime = int(timeList[0])*3600 + int(timeList[1])*60 + int(timeList[2]) |
| 59 | + elapsedTime = (int(timeList[0])*3600 + |
| 60 | + int(timeList[1])*60 + int(timeList[2])) |
59 | 61 | else: |
60 | | - print('Elapsed time not understood in', str(line), file=sys.stderr) |
| 62 | + print('Elapsed time not understood in', |
| 63 | + str(line), file=sys.stderr) |
61 | 64 |
|
62 | 65 | if not found: |
63 | | - print('No elapsed time found in', str(f), file=sys.stderr) |
| 66 | + print('No elapsed time found in', str(f), file=sys.stderr) |
64 | 67 | continue |
65 | 68 |
|
66 | 69 | # Print the name of the step and the corresponding elapsed time |
67 | 70 | if elapsedTime != 0: |
68 | 71 | if first and not args.noHeader: |
69 | 72 | print("%-25s %10s" % ("Log", "Elapsed seconds")) |
70 | 73 | first = False |
71 | | - print('%-25s %10s' % (os.path.splitext(os.path.basename(str(f)))[0], elapsedTime)) |
| 74 | + print('%-25s %10s' % (os.path.splitext( |
| 75 | + os.path.basename(str(f)))[0], elapsedTime)) |
72 | 76 | totalElapsed += elapsedTime |
73 | 77 |
|
74 | 78 | if totalElapsed != 0: |
75 | | - print("%-25s %10s" % ( "Total", totalElapsed )) |
| 79 | + print("%-25s %10s" % ("Total", totalElapsed)) |
| 80 | + |
76 | 81 |
|
77 | 82 | for log_dir in args.logDir: |
78 | 83 | print_log_dir_times(log_dir) |
0 commit comments