Permalink
Browse files

Fix display of coverage bar

  • Loading branch information...
1 parent 905f279 commit ac0fc3aba8950ef43206562577d0194eb894b067 @mandli committed Sep 20, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 doc/source/coverage_generator.py
View
@@ -40,16 +40,16 @@ def calculate_coverage(reader):
total_items += 1
if ":done:" in row[2] or ":done:" in row[3]:
done_items += 1
- elif ":partial:" in row[2] or ":partial:" in row[3]:
+ if ":partial:" in row[2] or ":partial:" in row[3]:
partial_items += 1
- elif ":na:" in row[2] or ":na:" in row[3]:
+ if ":na:" in row[2] or ":na:" in row[3]:
na_items += 1
counts = (done_items,
partial_items,
total_items - (partial_items + done_items + na_items),
na_items)
-
+
return list(i / total_items for i in counts)
def read_table_titles(reader):
@@ -235,7 +235,7 @@ def generate_page(csv_path,stream,page_title="Coverage Tables"):
for item, style in enumerate(('done-bar', 'partial-bar',
'missing-bar', 'na-bar')):
- stream.write('<td width="%s" class="%s">XX</td>' % \
+ stream.write('<td width="%s%%" class="%s">&nbsp</td>' % \
(item_counts[item] * 100, style))
stream.write("</tr></table>\n\n")
@@ -269,6 +269,6 @@ def generate_page(csv_path,stream,page_title="Coverage Tables"):
generate_page(csv_path,output)
output.close()
- print "Generated %s from %s." % (output_path,csv_path)
+ print("Generated %s from %s." % (output_path,csv_path))

0 comments on commit ac0fc3a

Please sign in to comment.