[Piglit] [PATCH 7/7] Rename mako templates in format <name>.<extension>.mako
Dylan Baker
baker.dylan.c at gmail.com
Thu Oct 17 15:09:43 CEST 2013
This should make it a little easier for someone looking through the code
to understand what these templates are for.
example: index.mako -> index.html.mako
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
framework/summary.py | 8 +--
templates/empty_status.html.mako | 27 +++++++++
templates/empty_status.mako | 27 ---------
templates/index.html.mako | 122 +++++++++++++++++++++++++++++++++++++++
templates/index.mako | 122 ---------------------------------------
templates/test_result.html.mako | 58 +++++++++++++++++++
templates/test_result.mako | 58 -------------------
templates/testrun_info.html.mako | 49 ++++++++++++++++
templates/testrun_info.mako | 49 ----------------
9 files changed, 260 insertions(+), 260 deletions(-)
create mode 100644 templates/empty_status.html.mako
delete mode 100644 templates/empty_status.mako
create mode 100644 templates/index.html.mako
delete mode 100644 templates/index.mako
create mode 100644 templates/test_result.html.mako
delete mode 100644 templates/test_result.mako
create mode 100644 templates/testrun_info.html.mako
delete mode 100644 templates/testrun_info.mako
diff --git a/framework/summary.py b/framework/summary.py
index c1f24a6..dacecbb 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -245,10 +245,10 @@ class Summary:
module_directory=".makotmp")
# Load the necissary templates
- testindex = templates.get_template("testrun_info.mako")
- testfile = templates.get_template("test_result.mako")
- makoindex = templates.get_template("index.mako")
- empty_status = templates.get_template("empty_status.mako")
+ testindex = templates.get_template("testrun_info.html.mako")
+ testfile = templates.get_template("test_result.html.mako")
+ makoindex = templates.get_template("index.html.mako")
+ empty_status = templates.get_template("empty_status.html.mako")
# Copy static files
copy("templates/index.css", path.join(destination, "index.css"))
diff --git a/templates/empty_status.html.mako b/templates/empty_status.html.mako
new file mode 100644
index 0000000..8ee6fba
--- /dev/null
+++ b/templates/empty_status.html.mako
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Result summary</title>
+ <link rel="stylesheet" href="status.css" type="text/css" />
+ </head>
+ <body>
+ <h1>Result summary</h1>
+ <p>Currently showing: ${page}</p>
+ <p>Show:
+ ## Index is a logical choice to put first, it will always be a link
+ ## and we don't want in preceeded by a |
+ <a href="index.html">index</a>
+ % for i in pages:
+ % if i == page:
+ | ${i}
+ % else:
+ | <a href="${i}.html">${i}</a>
+ % endif
+ % endfor
+ </p>
+ <h1>No ${page}</h1>
+ </body>
+</html>
diff --git a/templates/empty_status.mako b/templates/empty_status.mako
deleted file mode 100644
index 8ee6fba..0000000
--- a/templates/empty_status.mako
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Result summary</title>
- <link rel="stylesheet" href="status.css" type="text/css" />
- </head>
- <body>
- <h1>Result summary</h1>
- <p>Currently showing: ${page}</p>
- <p>Show:
- ## Index is a logical choice to put first, it will always be a link
- ## and we don't want in preceeded by a |
- <a href="index.html">index</a>
- % for i in pages:
- % if i == page:
- | ${i}
- % else:
- | <a href="${i}.html">${i}</a>
- % endif
- % endfor
- </p>
- <h1>No ${page}</h1>
- </body>
-</html>
diff --git a/templates/index.html.mako b/templates/index.html.mako
new file mode 100644
index 0000000..d9986f7
--- /dev/null
+++ b/templates/index.html.mako
@@ -0,0 +1,122 @@
+<%
+ import itertools
+ from os import path
+%>
+
+<%namespace name="functions" file="functions.mako" />
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Result summary</title>
+ <link rel="stylesheet" href="index.css" type="text/css" />
+ </head>
+ <body>
+ <h1>Result summary</h1>
+ <p>Currently showing: ${page}</p>
+ <p>Show:
+ % if page == 'all':
+ all
+ % else:
+ <a href="index.html">all</a>
+ % endif
+ % for i in pages:
+ % if i == page:
+ | ${i}
+ % else:
+ | <a href="${i}.html">${i}</a>
+ % endif
+ % endfor
+ </p>
+ <table>
+ <colgroup>
+ ## Name Column
+ <col />
+
+ ## Status columns
+ ## Create an additional column for each summary
+ % for _ in xrange(len(results)):
+ <col />
+ % endfor
+ </colgroup>
+
+ ## Create a new 'tab' for each result
+ ${functions.new_row()}
+ <td />
+ % for each in results:
+ <td class="head"><b>${each.name}</b><br />
+ <a href="${path.join(each.name, 'index.html')}">info</a>
+ </td>
+ % endfor
+ ${functions.end_row()}
+
+ ## Add the toplevel 'all' group
+ ${functions.new_row()}
+ ${functions.group_row("head", 0, "all")}
+ % for each in results:
+ ${functions.group_result(status[each.name]['all'], fractions[each.name]['all'])}
+ % endfor
+ ${functions.end_row()}
+
+ ## Generate the body of the index
+ <%
+ group = ""
+ depth = 1
+ %>
+
+ ## This loop relies on the tests being sorted alphabetically
+ % for test in sorted(tests):
+
+ ## If the current group is equal to path.dirname(test), they are sibliing tests,
+ ## otherwise figure out group chagnes
+ % if path.dirname(test) != group:
+
+ ## Calculate the relative path of the previous test's group and the current
+ ## test' groups
+ % for cur in path.relpath(path.dirname(test), group).split('/'):
+
+ ## Everytime we hit ".." decrease the indent in the HTML and set the group
+ % if cur == "..":
+ <%
+ depth -= 1
+ group = path.dirname(group)
+ %>
+
+ ## otherwise open a new group, and write it's data
+ % else:
+ <% group = path.join(group, cur) %>
+ ${functions.new_row()}
+ ${functions.group_row("head", depth, group)}
+ % for each in results:
+ % try:
+ ${functions.group_result(status[each.name][group],
+ fractions[each.name][group])}
+ % except KeyError:
+ ## If we hit this the group wasn't in one of multiple test runs
+ ${functions.group_result('skip', (0, 0))}
+ % endtry
+ % endfor
+ <% depth += 1 %>
+ ${functions.end_row()}
+ % endif
+ % endfor
+ % endif
+
+ ## Write the actual test now
+ ${functions.new_row()}
+ ${functions.test_row("group", depth, test)}
+ % for each in results:
+ % try:
+ ${functions.test_result(each.tests[test]['result'],
+ path.join(each.name, test + ".html"))}
+ % except KeyError:
+ <td class="skip">Not Run</td>
+ % endtry
+ % endfor
+ ${functions.end_row()}
+ % endfor
+ </table>
+ </body>
+</html>
diff --git a/templates/index.mako b/templates/index.mako
deleted file mode 100644
index d9986f7..0000000
--- a/templates/index.mako
+++ /dev/null
@@ -1,122 +0,0 @@
-<%
- import itertools
- from os import path
-%>
-
-<%namespace name="functions" file="functions.mako" />
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Result summary</title>
- <link rel="stylesheet" href="index.css" type="text/css" />
- </head>
- <body>
- <h1>Result summary</h1>
- <p>Currently showing: ${page}</p>
- <p>Show:
- % if page == 'all':
- all
- % else:
- <a href="index.html">all</a>
- % endif
- % for i in pages:
- % if i == page:
- | ${i}
- % else:
- | <a href="${i}.html">${i}</a>
- % endif
- % endfor
- </p>
- <table>
- <colgroup>
- ## Name Column
- <col />
-
- ## Status columns
- ## Create an additional column for each summary
- % for _ in xrange(len(results)):
- <col />
- % endfor
- </colgroup>
-
- ## Create a new 'tab' for each result
- ${functions.new_row()}
- <td />
- % for each in results:
- <td class="head"><b>${each.name}</b><br />
- <a href="${path.join(each.name, 'index.html')}">info</a>
- </td>
- % endfor
- ${functions.end_row()}
-
- ## Add the toplevel 'all' group
- ${functions.new_row()}
- ${functions.group_row("head", 0, "all")}
- % for each in results:
- ${functions.group_result(status[each.name]['all'], fractions[each.name]['all'])}
- % endfor
- ${functions.end_row()}
-
- ## Generate the body of the index
- <%
- group = ""
- depth = 1
- %>
-
- ## This loop relies on the tests being sorted alphabetically
- % for test in sorted(tests):
-
- ## If the current group is equal to path.dirname(test), they are sibliing tests,
- ## otherwise figure out group chagnes
- % if path.dirname(test) != group:
-
- ## Calculate the relative path of the previous test's group and the current
- ## test' groups
- % for cur in path.relpath(path.dirname(test), group).split('/'):
-
- ## Everytime we hit ".." decrease the indent in the HTML and set the group
- % if cur == "..":
- <%
- depth -= 1
- group = path.dirname(group)
- %>
-
- ## otherwise open a new group, and write it's data
- % else:
- <% group = path.join(group, cur) %>
- ${functions.new_row()}
- ${functions.group_row("head", depth, group)}
- % for each in results:
- % try:
- ${functions.group_result(status[each.name][group],
- fractions[each.name][group])}
- % except KeyError:
- ## If we hit this the group wasn't in one of multiple test runs
- ${functions.group_result('skip', (0, 0))}
- % endtry
- % endfor
- <% depth += 1 %>
- ${functions.end_row()}
- % endif
- % endfor
- % endif
-
- ## Write the actual test now
- ${functions.new_row()}
- ${functions.test_row("group", depth, test)}
- % for each in results:
- % try:
- ${functions.test_result(each.tests[test]['result'],
- path.join(each.name, test + ".html"))}
- % except KeyError:
- <td class="skip">Not Run</td>
- % endtry
- % endfor
- ${functions.end_row()}
- % endfor
- </table>
- </body>
-</html>
diff --git a/templates/test_result.html.mako b/templates/test_result.html.mako
new file mode 100644
index 0000000..b23fb8e
--- /dev/null
+++ b/templates/test_result.html.mako
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>${testname} - Details</title>
+ <link rel="stylesheet" href="${css}" type="text/css" />
+ </head>
+ <body>
+ <h1>Results for ${testname}</h1>
+ <h2>Overview</h2>
+ <div>
+ <p><b>Result:</b> ${status}</p>
+ </div>
+ <p><a href="${index}">Back to summary</a></p>
+ <h2>Details</h2>
+ <table>
+ <tr>
+ <th>Detail</th>
+ <th>Value</th>
+ </tr>
+ <tr>
+ <td>Returncode</td>
+ <td>${returncode}</td>
+ </tr>
+ <tr>
+ <td>Time</td>
+ <td>${time}</b>
+ </tr>
+ <tr>
+ <td>Info</td>
+ <td>
+ <pre>${info}</pre>
+ </td>
+ </tr>
+ <tr>
+ <td>Command</td>
+ <td>
+ </pre>${command}</pre>
+ </td>
+ </tr>
+ <tr>
+ <td>Traceback</td>
+ <td>
+ <pre>${traceback}</pre>
+ </td>
+ </tr>
+ <tr>
+ <td>dmesg</td>
+ <td>
+ <pre>${dmesg}</pre>
+ </td>
+ </tr>
+ </table>
+ <p><a href="${index}">Back to summary</a></p>
+ </body>
+</html>
diff --git a/templates/test_result.mako b/templates/test_result.mako
deleted file mode 100644
index b23fb8e..0000000
--- a/templates/test_result.mako
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>${testname} - Details</title>
- <link rel="stylesheet" href="${css}" type="text/css" />
- </head>
- <body>
- <h1>Results for ${testname}</h1>
- <h2>Overview</h2>
- <div>
- <p><b>Result:</b> ${status}</p>
- </div>
- <p><a href="${index}">Back to summary</a></p>
- <h2>Details</h2>
- <table>
- <tr>
- <th>Detail</th>
- <th>Value</th>
- </tr>
- <tr>
- <td>Returncode</td>
- <td>${returncode}</td>
- </tr>
- <tr>
- <td>Time</td>
- <td>${time}</b>
- </tr>
- <tr>
- <td>Info</td>
- <td>
- <pre>${info}</pre>
- </td>
- </tr>
- <tr>
- <td>Command</td>
- <td>
- </pre>${command}</pre>
- </td>
- </tr>
- <tr>
- <td>Traceback</td>
- <td>
- <pre>${traceback}</pre>
- </td>
- </tr>
- <tr>
- <td>dmesg</td>
- <td>
- <pre>${dmesg}</pre>
- </td>
- </tr>
- </table>
- <p><a href="${index}">Back to summary</a></p>
- </body>
-</html>
diff --git a/templates/testrun_info.html.mako b/templates/testrun_info.html.mako
new file mode 100644
index 0000000..e6e00b3
--- /dev/null
+++ b/templates/testrun_info.html.mako
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>${name} - System info</title>
+ <link rel="stylesheet" href="../result.css" type="text/css" />
+ </head>
+ <body>
+ <h1>System info for ${name}</h1>
+ <p>
+ <a href="../index.html">Back to summary</a>
+ </p>
+ <table>
+ <tr>
+ <th>Detail</th>
+ <th>Value</th>
+ </tr>
+ <tr>
+ <td>time_elapsed</td>
+ <td>${time}</td>
+ </tr>
+ <tr>
+ <td>name</td>
+ <td>${name}</td>
+ </tr>
+ <tr>
+ <td>options</td>
+ <td>${options}</td>
+ </tr>
+ <tr>
+ <td>lspci</td>
+ <td>
+ <pre>${lspci}</pre>
+ </td>
+ </tr>
+ <tr>
+ <td>glxinfo</td>
+ <td>
+ <pre>${glxinfo}</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ <a href="../index.html">Back to summary</a>
+ </p>
+ </body>
+</html>
diff --git a/templates/testrun_info.mako b/templates/testrun_info.mako
deleted file mode 100644
index e6e00b3..0000000
--- a/templates/testrun_info.mako
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//END"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>${name} - System info</title>
- <link rel="stylesheet" href="../result.css" type="text/css" />
- </head>
- <body>
- <h1>System info for ${name}</h1>
- <p>
- <a href="../index.html">Back to summary</a>
- </p>
- <table>
- <tr>
- <th>Detail</th>
- <th>Value</th>
- </tr>
- <tr>
- <td>time_elapsed</td>
- <td>${time}</td>
- </tr>
- <tr>
- <td>name</td>
- <td>${name}</td>
- </tr>
- <tr>
- <td>options</td>
- <td>${options}</td>
- </tr>
- <tr>
- <td>lspci</td>
- <td>
- <pre>${lspci}</pre>
- </td>
- </tr>
- <tr>
- <td>glxinfo</td>
- <td>
- <pre>${glxinfo}</pre>
- </td>
- </tr>
- </table>
- <p>
- <a href="../index.html">Back to summary</a>
- </p>
- </body>
-</html>
--
1.8.1.5
More information about the Piglit
mailing list