From 9abc3dcc7933091d6c31ff9896996b57654c5ebd Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Fri, 6 Oct 2017 02:54:07 -0400 Subject: 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. --- tools/TimeFileMaker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') 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) -- cgit v1.2.3