summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-11-05 19:26:23 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-11-05 19:26:23 +0000
commitf5cd24c80f7c1891c183265a2dfbcc6d956502dd (patch)
tree7deb9b0ce51e7bd50476ffc992cf9e31886baca2
parentc2912158ade4f5be3a26e1f327bc7860f7207ab0 (diff)
lightly prettier (?) results tables, with minimal actual code changes
This looks like it changes lots of files, but really all the changes are in disp lay.py. In the other files I just added display.print_main_header() so that all pages have the common header now, which they should have anyway. From: Steve Howard <showard@google.com> Signed-off-by: Martin Bligh <mbligh@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@909 592f7852-d20e-0410-864c-8624ca9c26a4
-rw-r--r--tko/compose_query.cgi1
-rwxr-xr-xtko/display.py27
-rwxr-xr-xtko/group_test.cgi1
-rwxr-xr-xtko/machine_kernel_test.cgi2
-rwxr-xr-xtko/machine_kernel_test_jobs.cgi1
-rw-r--r--tko/test.cgi3
6 files changed, 26 insertions, 9 deletions
diff --git a/tko/compose_query.cgi b/tko/compose_query.cgi
index 460513b3..1073c123 100644
--- a/tko/compose_query.cgi
+++ b/tko/compose_query.cgi
@@ -20,6 +20,7 @@ cgitb.enable()
db = db.db()
def main():
+ display.print_main_header()
# parse the fields from the form.
form = cgi.FieldStorage()
diff --git a/tko/display.py b/tko/display.py
index 40dda0b8..9d85a9d2 100755
--- a/tko/display.py
+++ b/tko/display.py
@@ -1,12 +1,16 @@
import os, re, parse, sys, frontend
color_map = {
- 'GOOD' : '#66ff66', # green
+ 'GOOD' : '#88ff88', # green
'WARN' : '#fffc00', # yellow
- 'FAIL' : '#ff6666', # red
- 'ABORT' : '#ff6666', # red
- 'ERROR' : '#ff6666', # red
+ 'FAIL' : '#ff8888', # red
+ 'ABORT' : '#ff8888', # red
+ 'ERROR' : '#ff8888', # red
'NOSTATUS' : '#ffffff', # white
+ 'header' : '#e5e5c0', # greyish yellow
+ 'blank' : '#ffffff', # white
+ 'plain_text' : '#e5e5c0', # greyish yellow
+ 'borders' : '#bbbbbb', # grey
'white' : '#ffffff', # white
'green' : '#66ff66', # green
'yellow' : '#fffc00', # yellow
@@ -22,8 +26,12 @@ class box:
self.data = data
if color_map.has_key(color_key):
self.color = color_map[color_key]
+ elif header:
+ self.color = color_map['header']
+ elif data:
+ self.color = color_map['plain_text']
else:
- self.color = color_map['white']
+ self.color = color_map['blank']
self.header = header
@@ -77,7 +85,7 @@ def status_count_box(db, tests, link = None):
if link:
html = '<a href="%s">%s</a>' % (link, html)
return box(html, db.status_word[worst])
-
+
def print_table(matrix):
"""
@@ -87,11 +95,11 @@ def print_table(matrix):
Display the given matrix of data as a table.
"""
- print '<table cellpadding=5 border=1 class="boldtable">'
+ print '<table bgcolor="%s" cellspacing="1" cellpadding="5">' % (
+ color_map['borders'])
for row in matrix:
print '<tr>'
for element in row:
- print element
print element.html()
print '</tr>'
print '</table>'
@@ -110,6 +118,9 @@ def sort_tests(tests):
def print_main_header():
+ print '<head><style type="text/css">'
+ print 'a { text-decoration: none }'
+ print '</style></head>'
print '<h2>'
print '<a href="machine_kernel.cgi">Functional</a>'
print '&nbsp&nbsp&nbsp'
diff --git a/tko/group_test.cgi b/tko/group_test.cgi
index 17287262..3df8e797 100755
--- a/tko/group_test.cgi
+++ b/tko/group_test.cgi
@@ -11,6 +11,7 @@ import db, display, frontend
db = db.db()
def main():
+ display.print_main_header()
form = cgi.FieldStorage()
kernel_idx = form["kernel"].value
diff --git a/tko/machine_kernel_test.cgi b/tko/machine_kernel_test.cgi
index 39535941..c3d1866c 100755
--- a/tko/machine_kernel_test.cgi
+++ b/tko/machine_kernel_test.cgi
@@ -11,6 +11,8 @@ import db, display, frontend
db = db.db()
def main():
+ display.print_main_header()
+
form = cgi.FieldStorage()
kernel_idx = form['kernel'].value
diff --git a/tko/machine_kernel_test_jobs.cgi b/tko/machine_kernel_test_jobs.cgi
index a41030ac..6150f5c9 100755
--- a/tko/machine_kernel_test_jobs.cgi
+++ b/tko/machine_kernel_test_jobs.cgi
@@ -11,6 +11,7 @@ import db, display, frontend
db = db.db()
def main():
+ display.print_main_header()
form = cgi.FieldStorage()
kernel_idx = form['kernel'].value
diff --git a/tko/test.cgi b/tko/test.cgi
index dd858b00..d96d82f5 100644
--- a/tko/test.cgi
+++ b/tko/test.cgi
@@ -16,6 +16,8 @@ import db, display, frontend
db = db.db()
def main():
+ display.print_main_header()
+
form = cgi.FieldStorage()
if form.has_key('sql'):
@@ -64,4 +66,3 @@ def main():
display.print_table(matrix)
main()
-