aboutsummaryrefslogtreecommitdiff
path: root/crosperf/results_report_templates.py
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2017-04-06 17:16:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-04-08 19:40:20 -0700
commitf6ef4395fe1896ba68c80e52cb24763b0fcfe7f8 (patch)
tree7612123711db98f0746e56b66368d16b388192bd /crosperf/results_report_templates.py
parent8c18be1425c8a4ecfc059a7c637fc93f33edab1f (diff)
downloadtoolchain-utils-f6ef4395fe1896ba68c80e52cb24763b0fcfe7f8.tar.gz
[toolchain-utils] Fix remaining lint errors in toolchain-utils.
In addition to fixing the lint errors, this also fixes the Python formatting issues (ran tc_pyformat on nearly all the files). BUG=chromium:570450 TEST=Ran all crosperf & bisect tool unit tests. Ran afe_lock_machine.py (check machine status) Ran full crosperf test (octane, speedometer, BootPerf) on alex. Change-Id: Ic86f9192801ac67769f3de30f1c5f0d203ce0831 Reviewed-on: https://chromium-review.googlesource.com/471886 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'crosperf/results_report_templates.py')
-rw-r--r--crosperf/results_report_templates.py33
1 files changed, 20 insertions, 13 deletions
diff --git a/crosperf/results_report_templates.py b/crosperf/results_report_templates.py
index 827649fd..15ce5827 100644
--- a/crosperf/results_report_templates.py
+++ b/crosperf/results_report_templates.py
@@ -14,6 +14,7 @@ _TabMenuTemplate = Template("""
<a href="javascript:switchTab('$table_name', 'tsv')">TSV</a>
</div>""")
+
def _GetTabMenuHTML(table_name):
# N.B. cgi.escape does some very basic HTML escaping. Nothing more.
escaped = cgi.escape(table_name, quote=True)
@@ -28,10 +29,11 @@ _ExperimentFileHTML = """
</div>
"""
+
def _GetExperimentFileHTML(experiment_file_text):
if not experiment_file_text:
return ''
- return _ExperimentFileHTML % (cgi.escape(experiment_file_text), )
+ return _ExperimentFileHTML % (cgi.escape(experiment_file_text),)
_ResultsSectionHTML = Template("""
@@ -46,16 +48,17 @@ _ResultsSectionHTML = Template("""
</div>
""")
+
def _GetResultsSectionHTML(print_table, table_name, data):
first_word = table_name.strip().split()[0]
short_name = first_word.lower()
- return _ResultsSectionHTML.substitute(sect_name=table_name,
- html_table=print_table(data, 'HTML'),
- text_table=print_table(data, 'PLAIN'),
- tsv_table=print_table(data, 'TSV'),
- tab_menu=_GetTabMenuHTML(short_name),
- short_name=short_name)
-
+ return _ResultsSectionHTML.substitute(
+ sect_name=table_name,
+ html_table=print_table(data, 'HTML'),
+ text_table=print_table(data, 'PLAIN'),
+ tsv_table=print_table(data, 'TSV'),
+ tab_menu=_GetTabMenuHTML(short_name),
+ short_name=short_name)
_MainHTML = Template("""
@@ -166,6 +169,7 @@ _MainHTML = Template("""
</html>
""")
+
# It's a bit ugly that we take some HTML things, and some non-HTML things, but I
# need to balance prettiness with time spent making things pretty.
def GenerateHTMLPage(perf_table, chart_js, summary_table, print_table,
@@ -189,8 +193,11 @@ def GenerateHTMLPage(perf_table, chart_js, summary_table, print_table,
full_table_html = _GetResultsSectionHTML(print_table, 'Full Table',
full_table)
experiment_file_html = _GetExperimentFileHTML(experiment_file)
- return _MainHTML.substitute(perf_init=perf_init, chart_js=chart_js,
- summary_table=summary_table_html,
- perf_html=perf_html, chart_divs=chart_divs,
- full_table=full_table_html,
- experiment_file=experiment_file_html)
+ return _MainHTML.substitute(
+ perf_init=perf_init,
+ chart_js=chart_js,
+ summary_table=summary_table_html,
+ perf_html=perf_html,
+ chart_divs=chart_divs,
+ full_table=full_table_html,
+ experiment_file=experiment_file_html)