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>
import argparse
import sqlite3
import jinja2
+import datetime
__version__ = "0.0.3"
__license__ = "APACHE-2.0"
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()