From 6b4016be420b0ce586d6b8f97411575b2f41dfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 27 Nov 2013 19:17:22 +0100 Subject: [PATCH] daca2-report: get results from aws and show most recent results on web --- tools/daca2-report.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/daca2-report.py b/tools/daca2-report.py index e493fadc1..483f730bb 100644 --- a/tools/daca2-report.py +++ b/tools/daca2-report.py @@ -1,5 +1,6 @@ import os import sys +import subprocess def readdate(data): @@ -30,6 +31,13 @@ def readdate(data): return None datepos = datepos + 1 +if os.path.isfile(os.path.expanduser('~/aws-debian.pem')): + subprocess.call(['scp', + '-i', + os.path.expanduser('~/aws-debian.pem'), + 'admin@ec2-54-201-59-232.us-west-2.compute.amazonaws.com:daca2/results-*.txt', + os.path.expanduser('~/daca2/')]) + path = '.' if len(sys.argv) == 2: path = sys.argv[1] @@ -75,6 +83,17 @@ for lib in range(2): f.close() datestr = readdate(data) + + if os.path.isfile(daca2 + 'results-' + a + '.txt'): + f2 = open(daca2 + 'results-' + a + '.txt') + data2 = f2.read() + f2.close() + + datestr2 = readdate(data2) + if not datestr or datestr < datestr2: + data = data2 + datestr = datestr2 + if datestr: if not lastupdate or datestr > lastupdate: lastupdate = datestr