From 164a46f8cd6ca04ab1c42f138ee8743f69941c9c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 4 Jan 2019 11:51:32 +0100 Subject: [PATCH] donate-cpu-server.py: Fix date/time in report is not found. (#1562) Instead of searching for a specific year (which could change) the script searches now for the current and last year to find the date and time information in the results. --- tools/donate-cpu-server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/donate-cpu-server.py b/tools/donate-cpu-server.py index 55d1348db..5ce0fdf17 100644 --- a/tools/donate-cpu-server.py +++ b/tools/donate-cpu-server.py @@ -67,7 +67,8 @@ def latestReport(latestResults): added = 0 for line in open(filename,'rt'): line = line.strip() - if line.startswith('2018-'): + current_year = datetime.date.today().year + if line.startswith(str(current_year) + '-') or line.startswith(str(current_year - 1) + '-'): datestr = line #elif line.startswith('cppcheck:'): # cppcheck = line[9:]