summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-15 06:38:10 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-15 06:38:10 -0400
commit19e52a9bdcfc3318efb2cdcbf1e9cf3343b3dbf8 (patch)
tree972db1acbbc684ed65af93e96f971e535e7d28c3 /coverage/html.py
parent3722bcb056f0d1bf5562d8c31341eaf0a7ae5977 (diff)
downloadpython-coveragepy-git-19e52a9bdcfc3318efb2cdcbf1e9cf3343b3dbf8.tar.gz
Refactor the analysis results so we aren't passing so many tuples around.
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/coverage/html.py b/coverage/html.py
index f096c728..d5811317 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -82,15 +82,15 @@ class HtmlReporter(Reporter):
os.path.join(directory, "jquery-1.3.2.min.js")
)
- def html_file(self, cu, statements, excluded, missing):
+ def html_file(self, cu, analysis):
"""Generate an HTML file for one source file."""
source = cu.source_file().read().expandtabs(4)
source_lines = source.split("\n")
- n_stm = len(statements)
- n_exc = len(excluded)
- n_mis = len(missing)
+ n_stm = len(analysis.statements)
+ n_exc = len(analysis.excluded)
+ n_mis = len(analysis.missing)
n_run = n_stm - n_mis
if n_stm > 0:
pc_cov = 100.0 * n_run / n_stm
@@ -114,13 +114,13 @@ class HtmlReporter(Reporter):
if part == '\n':
line_class = ""
- if lineno in statements:
+ if lineno in analysis.statements:
line_class += " stm"
- if lineno not in missing and lineno not in excluded:
+ if lineno not in analysis.missing and lineno not in analysis.excluded:
line_class += c_run
- if lineno in excluded:
+ if lineno in analysis.excluded:
line_class += c_exc
- if lineno in missing:
+ if lineno in analysis.missing:
line_class += c_mis
lineinfo = {