<div dir="ltr">Cool, I can make those changes.<div><br></div><div style>As a side note, mako indents are wysiwyg, so there is a balancing act between getting an easy to read template and an easy to read output.</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 25, 2013 at 2:34 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/17/2013 09:31 AM, Dylan Baker wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Adds the actual templates used to by the new mako based summary code.<br>
<br>
Signed-off-by: Dylan Baker <<a href="mailto:baker.dylan.c@gmail.com" target="_blank">baker.dylan.c@gmail.com</a>><br>
</blockquote>
<br></div>
It would be great to use spaces in this (rather than tabs) for consistency. The embedded Python code already uses spaces.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
templates/index.mako | 79 ++++++++++++++++++++++++++++++<u></u>++++++++++++++++<br>
templates/test_index.mako | 49 ++++++++++++++++++++++++++++<br>
templates/test_result.mako | 47 +++++++++++++++++++++++++++<br>
3 files changed, 175 insertions(+)<br>
create mode 100644 templates/index.mako<br>
create mode 100644 templates/test_index.mako<br>
create mode 100644 templates/test_result.mako<br>
<br>
diff --git a/templates/index.mako b/templates/index.mako<br>
new file mode 100644<br>
index 0000000..acc597d<br>
--- /dev/null<br>
+++ b/templates/index.mako<br>
@@ -0,0 +1,79 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br>
+ "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/<u></u>DTD/xhtml1-strict.dtd</a>"><br>
+<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/<u></u>xhtml</a>"><br>
+ <head><br>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br>
+ <title>Result summary</title><br>
+ <link rel="stylesheet" href="index.css" type="text/css" /><br>
+ </head><br>
+ <body><br>
+ <h1>Result summary</h1><br>
+ <p>Currently showing: all</p><br>
+ <p>Show:<br>
+ % for i in ['index', 'changes', 'fixes', 'problems', 'regressions', 'skipped']:<br>
+ % if i == page:<br>
+ ${page}<br>
+ % elif i == 'index':<br>
+ % if page == 'all':<br>
+ all<br>
+ % else:<br>
+ <a href="index.html">all</a><br>
+ % endif<br>
+ % else:<br>
+ <a href="${i}.html">${i}</a><br>
+ % endif<br>
+ % if i != "skipped":<br>
+ |<br>
+ % endif<br>
+ % endfor<br>
</blockquote>
<br></div></div>
Since the first item in your list (index/all) is a special case, you might consider doing that outside the loop. Then, you can put | before each link, and you won't have to special case 'skipped':<div class="im">
<br>
<br>
% if page == 'all':<br></div>
all<br>
% else:<div class="im"><br>
<a href="index.html">all</a><br></div>
% endif<br>
<br>
% for i in ['changes', 'fixes', 'problems', 'regressions', 'skipped']:<div class="im"><br>
|<br>
% if i == page:<br></div>
${page}<br>
% else:<div class="im"><br>
<a href="${i}.html">${i}</a><br></div>
% endif:<br>
% endfor<br>
<br>
It's a bit tidier that way. (I probably botched the indenting, I haven't yet learned how that works in Mako...)<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ </p><br>
+ <table><br>
+ <colgroup><br>
+ ## Name Column<br>
+ <col /><br>
+<br>
+ ## Status columns<br>
+ ## Create an additional column for each summary<br>
+ % for _ in xrange(colnum):<br>
+ <col /><br>
+ % endfor<br>
+ </colgroup><br>
+ % for line in results:<br>
+ % if line['type'] == "newRow":<br>
+ <tr><br>
+ % elif line['type'] == "endRow":<br>
+ </tr><br>
+ % elif line['type'] == "groupRow":<br>
+ <td><br>
+ <div class="${line['class']}" style="margin-left: ${line['indent']}em"><br>
+ <b>${line['text']}</b><br>
+ </div><br>
+ </td><br>
+ % elif line['type'] == "testRow":<br>
+ <td><br>
+ <div class="${line['class']}" style="margin-left: ${line['indent']}em"><br>
+ ${line['text']}<br>
+ </div><br>
+ </td><br>
+ % elif line['type'] == "groupResult":<br>
+ <td class="${line['class']}"><br>
+ <b>${line['text']}</b><br>
+ </td><br>
+ % elif line['type'] == "testResult":<br>
+ <td class="${line['class']}"><br>
+ <a href="${line['href']}"><br>
+ ${line['text']}<br>
+ </a><br>
+ </td><br>
+ % elif line['type'] == "subtestResult":<br>
+ <td class="${line['class']}"><br>
+ ${line['text']}<br>
+ </td><br>
+ % elif line['type'] == "other":<br>
+ ${line['text']}<br>
+ % endif<br>
+ % endfor<br>
+ </table><br>
+ </body><br>
+</html><br>
diff --git a/templates/test_index.mako b/templates/test_index.mako<br>
new file mode 100644<br>
index 0000000..edfab91<br>
--- /dev/null<br>
+++ b/templates/test_index.mako<br>
</blockquote>
<br></div></div>
Perhaps call this test_run_info.mako? This page contains system info, and the link to get there is "(info)", so that name makes it pretty clear what the page is at a glance.<br>
<br>
In contrast, "test" makes me think of an individual test (rather than a whole test run) and "index" is pretty generic.<br>
<br>
I don't feel too strongly about it though.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -0,0 +1,49 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"<br>
+ "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/<u></u>DTD/xhtml1-strict.dtd</a>"><br>
+<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/<u></u>xhtml</a>"><br>
+ <head><br>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br>
+ <title>${name} - System info</title><br>
+ <link rel="stylesheet" href="../result.css" type="text/css" /><br>
+ </head><br>
+ <body><br>
+ <h1>System info for ${name}</h1><br>
+ <p><br>
+ <a href="../index.html">Back to summary</a><br>
+ </p><br>
+ <table><br>
+ <tr><br>
+ <th>Detail</th><br>
+ <th>Value</th><br>
+ </tr><br>
+ <tr><br>
+ <td>time_elapsed</td><br>
+ <td>${time}</td><br>
+ </tr><br>
+ <tr><br>
+ <td>name</td><br>
+ <td>${name}</td><br>
+ </tr><br>
+ <tr><br>
+ <td>options</td><br>
+ <td>${options}</td><br>
+ </tr><br>
+ <tr><br>
+ <td>lspci</td><br>
+ <td><br>
+ <pre>${lspci}</pre><br>
+ </td><br>
+ </tr><br>
+ <tr><br>
+ <td>glxinfo</td><br>
+ <td><br>
+ <pre>${glxinfo}</pre><br>
+ </td><br>
+ </tr><br>
+ </table><br>
+ <p><br>
+ <a href="../index.html">Back to summary</a><br>
+ </p><br>
+ </body><br>
+</html><br>
diff --git a/templates/test_result.mako b/templates/test_result.mako<br>
new file mode 100644<br>
index 0000000..1f944cb<br>
--- /dev/null<br>
+++ b/templates/test_result.mako<br>
@@ -0,0 +1,47 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"<br>
+ "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/<u></u>DTD/xhtml1-strict.dtd</a>"><br>
+<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/<u></u>xhtml</a>"><br>
+ <head><br>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br>
+ <title>${testname} - Details</title><br>
+ <link rel="stylesheet" href="../result.css" type="text/css" /><br>
+ </head><br>
+ <body><br>
+ <h1>Results for ${testname}</h1><br>
+ <h2>Overview</h2><br>
+ <div><br>
+ <p><b>Status:</b> ${status}</p><br>
+ <p><b>Result:</b> ${status}</p><br>
+ </div><br>
+ <p><a href="../index.html">Back to summary</a></p><br>
+ <h2>Details</h2><br>
+ <table><br>
+ <tr><br>
+ <th>Detail</th><br>
+ <th>Value</th><br>
+ </tr><br>
+ <tr><br>
+ <td>Returncode</td><br>
+ <td>${returncode}</td><br>
+ </tr><br>
+ <tr><br>
+ <td>Time</td><br>
+ <td>${time}</b><br>
+ </tr><br>
+ <tr><br>
+ <td>Info</td><br>
+ <td><br>
+ <pre>${info}</pre><br>
+ </td><br>
+ </tr><br>
+ <tr><br>
+ <td>Command</td><br>
+ <td><br>
+ </pre>${command}</pre><br>
+ </td><br>
+ </tr><br>
+ </table><br>
+ <p><a href="../index.html">Back to summary</a></p><br>
+ </body><br>
+</html><br>
</blockquote>
<br></div></div>
Other than those suggestions, this looks good to me!<br>
</blockquote></div><br></div>