summaryrefslogtreecommitdiff
path: root/tsp/scripts
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-12-16 11:28:25 +0100
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-02-01 17:36:51 +0100
commite82b10b90b535b8d1036499511b10b4fd55ce858 (patch)
tree3d75d3ea64ddbad82df1160075f10e90f399f7e7 /tsp/scripts
parent1a0b5fa022240e978276c6daa91bfddb1a1547db (diff)
downloadmajor-e82b10b90b535b8d1036499511b10b4fd55ce858.tar.gz
major-e82b10b90b535b8d1036499511b10b4fd55ce858.tar.bz2
major-e82b10b90b535b8d1036499511b10b4fd55ce858.zip
Make results colorful
Meaning of the colors in html results: * yellow - not modified in last 2h, but less than 6h and not in the final state * red - not modified for at least 6h and not in the final state Final state is one of OK, Unclear or Fail. Change-Id: Ie7a1bf4a391ff7db543a2b1d078e0dffb00057f0 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Diffstat (limited to 'tsp/scripts')
-rwxr-xr-xtsp/scripts/publish.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tsp/scripts/publish.py b/tsp/scripts/publish.py
index 38e51b5..b9237d1 100755
--- a/tsp/scripts/publish.py
+++ b/tsp/scripts/publish.py
@@ -21,6 +21,7 @@
import argparse
import sqlite3
import jinja2
+import datetime
__version__ = "0.0.3"
__license__ = "APACHE-2.0"
@@ -82,6 +83,15 @@ def print_view(dbpath, tizen3):
if not sr == prev_sr:
prev_sr = sr
col = next_color(col)
+ m_date = datetime.datetime.strptime(row[1], "%Y-%m-%d %H:%M:%S")
+ timedelta = datetime.datetime.utcnow() - m_date
+ if ( row[4] == 'In test queue' or row[4] == 'Testing' or row[4] == 'Downloading' ) and timedelta < datetime.timedelta(days=2):
+ if timedelta > datetime.timedelta(hours=6):
+ print_row(row, "red")
+ continue
+ elif timedelta > datetime.timedelta(hours=2):
+ print_row(row, "yellow")
+ continue
print_row(row, col)
conn.close()