aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-10-06 02:54:07 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-10-06 02:54:07 -0400
commit9abc3dcc7933091d6c31ff9896996b57654c5ebd (patch)
tree8209e8d73c2965c6855bc4eb292c8d882db49837 /tools
parent2aac4ae818fec0d409da31ef9da83796d871d687 (diff)
TimeFileMaker.py: Allow trailing spaces
This allows the timing aggregation scripts to handle logs from Travis, which, for some reason, seems to insert trailing spaces.
Diffstat (limited to 'tools')
-rw-r--r--tools/TimeFileMaker.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/TimeFileMaker.py b/tools/TimeFileMaker.py
index a207c2171..7298ef5e8 100644
--- a/tools/TimeFileMaker.py
+++ b/tools/TimeFileMaker.py
@@ -28,10 +28,10 @@ def get_times(file_name):
else:
with open(file_name, 'r') as f:
lines = f.read()
- reg = re.compile(r'^([^\s]+) \([^\)]*?user: ([0-9\.]+)[^\)]*?\)$', re.MULTILINE)
+ reg = re.compile(r'^([^\s]+) \([^\)]*?user: ([0-9\.]+)[^\)]*?\)\s*$', re.MULTILINE)
times = reg.findall(lines)
if all(time in ('0.00', '0.01') for name, time in times):
- reg = re.compile(r'^([^\s]*) \([^\)]*?real: ([0-9\.]+)[^\)]*?\)$', re.MULTILINE)
+ reg = re.compile(r'^([^\s]*) \([^\)]*?real: ([0-9\.]+)[^\)]*?\)\s*$', re.MULTILINE)
times = reg.findall(lines)
if all(STRIP_REG.search(name.strip()) for name, time in times):
times = tuple((STRIP_REG.sub(STRIP_REP, name.strip()), time) for name, time in times)