diff options
author | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-04-16 23:29:13 +0000 |
---|---|---|
committer | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-04-16 23:29:13 +0000 |
commit | 9ff28bf0f6549cd6214b7e1650ac6410074e4f7c (patch) | |
tree | ac58f78a38bfc58d1a4bb06bd0dd083b8d3ed1a2 /tko/compose_query.cgi | |
parent | 244de5669f672711af7023ab6e3967d8652a0661 (diff) |
Exposed the title field in the report.
From: Fa Yoeu <fayoeu@google.com>
Signed-off-by: Martin Bligh <mbligh@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@1442 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/compose_query.cgi')
-rwxr-xr-x | tko/compose_query.cgi | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tko/compose_query.cgi b/tko/compose_query.cgi index d609fa2e..11db9bed 100755 --- a/tko/compose_query.cgi +++ b/tko/compose_query.cgi @@ -43,7 +43,7 @@ html_header = """\ </td> <td> <input type="text" name="condition" size="30" value="%s"> - <input type="hidden" name="title" value="Report"> + <input type="hidden" name="title" value="%s"> </td> <td align="center"><input type="submit" value="Submit"> </td> @@ -86,10 +86,12 @@ def parse_condition(form, form_field, field_default): form = cgi.FieldStorage() +title_field = parse_condition(form, 'title', '') try: row = parse_field(form, 'rows') column = parse_field(form, 'columns') condition_field = parse_condition(form, 'condition','') + except KeyError: ## first time here ## to start faster, begin with records of last week only @@ -132,8 +134,10 @@ def construct_link(x, y): next_column = next_field[column] condition_list.append("%s='%s'" % (column, x)) next_condition = '&'.join(condition_list) - return 'compose_query.cgi?' + urllib.urlencode({'columns': next_column, - 'rows': next_row, 'condition': next_condition}) + link = 'compose_query.cgi?' + urllib.urlencode({'columns': next_column, + 'rows': next_row, 'condition': next_condition, + 'title': title_field}) + return link def create_select_options(selected_val): @@ -268,7 +272,8 @@ def gen_matrix(): return [[display.box(msg)]] dict_url = {'columns': row, - 'rows': column, 'condition': condition_field} + 'rows': column, 'condition': condition_field, + 'title': title_field} link = 'compose_query.cgi?' + urllib.urlencode(dict_url) header_row = [display.box("<center>(Flip Axis)</center>", link=link)] @@ -329,7 +334,9 @@ def main(): display.print_main_header() print html_header % (create_select_options(column), create_select_options(row), - condition_field) + condition_field, title_field) + if title_field: + print '<h1> %s </h1>' % (title_field) print display.color_keys_row() display.print_table(gen_matrix()) print display.color_keys_row() |