Commit 05bc5eb9 authored by Dylan Baker's avatar Dylan Baker

summary: Generate a new empty page for pages with no results

This new page is able to convey the same information, but takes less
time to generate

v2: - Change message to say "No ${page}".
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker's avatarDylan Baker <baker.dylan.c@gmail.com>
parent c8239501
......@@ -756,6 +756,10 @@ class NewSummary:
output_encoding="utf-8",
module_directory=".makotmp")
empty_status = Template(filename="templates/empty_status.mako",
output_encoding="utf-8",
module_directory=".makotmp")
# A list of pages to be generated
# If there is only one set of results, then there cannot be changes,
# regressions or fixes, so don't generate those pages
......@@ -778,9 +782,16 @@ class NewSummary:
# Generate the rest of the pages
for page in pages:
file = open(path.join(destination, page + '.html'), 'w')
file.write(index.render(results=HTMLIndex(self, self.tests[page]),
page=page,
pages=pages,
colnum=len(self.results),
exclude=exclude))
# If there is information to display display it
if self.tests[page]:
file.write(index.render(results=HTMLIndex(self,
self.tests[page]),
pages=pages,
page=page,
colnum=len(self.results),
exclude=exclude))
# otherwise provide an empty page
else:
file.write(empty_status.render(page=page, pages=pages))
file.close()
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment