diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-24 23:28:27 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-24 23:28:27 -0400 |
commit | 136798ef488c926f10c02d3b5aa0190ac27b69f2 (patch) | |
tree | 8f79bce415a07a5608222045066480af172bdf7b /coverage/html.py | |
parent | 21cf03f2a863f56716d3c864de6f0baa29338a88 (diff) | |
download | python-coveragepy-git-136798ef488c926f10c02d3b5aa0190ac27b69f2.tar.gz |
Use jquery to enable hiding and showing highlighting of source lines in HTML reports.
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/coverage/html.py b/coverage/html.py index 61356856..ada19d93 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -37,6 +37,10 @@ class HtmlReporter(Reporter): data_filename("htmlfiles/style.css"), os.path.join(directory, "style.css") ) + shutil.copyfile( + data_filename("htmlfiles/jquery-1.3.2.min.js"), + os.path.join(directory, "jquery-1.3.2.min.js") + ) # Process all the files. self.report_files(self.html_file, morfs, directory, omit_prefixes) @@ -51,8 +55,9 @@ class HtmlReporter(Reporter): n_stm = len(statements) n_exc = len(excluded) n_mis = len(missing) + n_run = n_stm - n_mis if n_stm > 0: - pc_cov = 100.0 * float(n_stm - n_mis) / n_stm + pc_cov = 100.0 * float(n_run) / n_stm else: pc_cov = 100.0 @@ -65,7 +70,7 @@ class HtmlReporter(Reporter): if lineno in statements: css_class += " stm" if lineno not in missing and lineno not in excluded: - css_class += " run" + css_class += " run hide" if lineno in excluded: css_class += " exc" if lineno in missing: |