<div dir="ltr">I'm bumping this series hoping to get some review, since I feel it's too big to 'just push'<div><br></div><div>Brian and Jose, I'd specifically appreciate if you would look at the later set of patches, since they change/replace code that you originally wrote.</div>
<div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 8:36 AM, Dylan Baker <span dir="ltr"><<a href="mailto:baker.dylan.c@gmail.com" target="_blank">baker.dylan.c@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Replaces self.alltests, self.changes, self.problems, self.regressions,<br>
self.fixes, and self.skipped with self.test, a dictionary containing all<br>
of the same information. This cleans the namespace for the NewSummary<br>
object, as well as allowing for some other code simplification<br>
<br>
Signed-off-by: Dylan Baker <<a href="mailto:baker.dylan.c@gmail.com">baker.dylan.c@gmail.com</a>><br>
---<br>
framework/summary.py | 35 +++++++++++++++--------------------<br>
1 file changed, 15 insertions(+), 20 deletions(-)<br>
<br>
diff --git a/framework/summary.py b/framework/summary.py<br>
index b5ddd95..bd0f4cd 100644<br>
--- a/framework/summary.py<br>
+++ b/framework/summary.py<br>
@@ -360,7 +360,7 @@ class HTMLIndex(list):<br>
self._endRow()<br>
<br>
# Add the groups and tests to the out list<br>
- for key in sorted(getattr(summary, page)):<br>
+ for key in sorted(page):<br>
<br>
# Split the group names and test names, then determine<br>
# which groups to close and which to open<br>
@@ -628,12 +628,8 @@ class NewSummary:<br>
<br>
self.status = {}<br>
self.fractions = {}<br>
- self.alltests = []<br>
- self.changes = []<br>
- self.problems = []<br>
- self.skipped = []<br>
- self.regressions = []<br>
- self.fixes = []<br>
+ self.tests = {'all': [], 'changes': [], 'problems': [], 'skipped': [],<br>
+ 'regressions': [], 'fixes': []}<br>
<br>
for each in self.results:<br>
# Build a dict of the status output of all of the tests, with the<br>
@@ -644,12 +640,11 @@ class NewSummary:<br>
self.status.update({<a href="http://each.name" target="_blank">each.name</a>: status})<br>
<br>
# Create a list with all the test names in it<br>
- self.alltests = list(set(self.alltests) | set(each.tests))<br>
+ self.tests['all'] = list(set(self.tests['all']) | set(each.tests))<br>
<br>
- # Create lists similar to self.alltests, but for the other root pages,<br>
- # (regressions, skips, ect). Special is used to makr things that cannot<br>
- # be comapred (like 'not run')<br>
- for test in self.alltests:<br>
+ # Create lists similar to self.tests['all'], but for the other root<br>
+ # pages, (regressions, skips, ect)<br>
+ for test in self.tests['all']:<br>
status = []<br>
for each in self.results:<br>
try:<br>
@@ -657,23 +652,23 @@ class NewSummary:<br>
except KeyError:<br>
status.append(status_to_number("special"))<br>
<br>
- # Check and append self.changes<br>
+ # Check and append self.tests['changes']<br>
# A set cannot contain duplicate entries, so creating a set out<br>
# the list will reduce it's length to 1 if all entries are the<br>
# same, meaning it is not a change<br>
if len(set(status)) > 1:<br>
- self.changes.append(test)<br>
+ self.tests['changes'].append(test)<br>
<br>
# Problems<br>
# If the result contains a value other than 1 (pass) or 4 (skip)<br>
# it is a problem. Skips are not problems becasuse they have<br>
# Their own page.<br>
if [i for e in [2, 3, 5] for i in status if e is i]:<br>
- self.problems.append(test)<br>
+ self.tests['problems'].append(test)<br>
<br>
# skipped<br>
if 4 in status:<br>
- self.skipped.append(test)<br>
+ self.tests['skipped'].append(test)<br>
<br>
# fixes and regressions<br>
# check each member against the next member. If the second member<br>
@@ -683,9 +678,9 @@ class NewSummary:<br>
# a value of 1<br>
for i in xrange(len(status) - 1):<br>
if status[i] < status[i + 1] and status[i] != 0:<br>
- self.regressions.append(test)<br>
+ self.tests['regressions'].append(test)<br>
if status[i] > 1 and status[i + 1] == 1:<br>
- self.fixes.append(test)<br>
+ self.tests['fixes'].append(test)<br>
<br>
def generateHTML(self, destination, exclude):<br>
"""<br>
@@ -768,7 +763,7 @@ class NewSummary:<br>
# alltests, where the other pages all use the same name. ie,<br>
# changes.html, self.changes, and page=changes.<br>
file = open(path.join(destination, "index.html"), 'w')<br>
- file.write(index.render(results=HTMLIndex(self, 'alltests'),<br>
+ file.write(index.render(results=HTMLIndex(self, self.tests['all']),<br>
page='all',<br>
colnum=len(self.results),<br>
exclude=exclude))<br>
@@ -777,7 +772,7 @@ class NewSummary:<br>
# Generate the rest of the pages<br>
for page in pages:<br>
file = open(path.join(destination, page + '.html'), 'w')<br>
- file.write(index.render(results=HTMLIndex(self, page),<br>
+ file.write(index.render(results=HTMLIndex(self, self.tests[page]),<br>
page=page,<br>
colnum=len(self.results),<br>
exclude=exclude))<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.4<br>
<br>
</font></span></blockquote></div><br></div>