diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-25 07:26:44 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-25 07:26:44 -0400 |
| commit | 41804075a23bf70c5fcfadaf2be41009b480d299 (patch) | |
| tree | 0efab1448847dc7a136a88917ee3c13a012634d8 /coverage | |
| parent | 8dd7458290f99dc035a78b75e03f15b1e076b692 (diff) | |
| download | python-coveragepy-41804075a23bf70c5fcfadaf2be41009b480d299.tar.gz | |
Better modularity about which line classes are highlighted by default.
Diffstat (limited to 'coverage')
| -rw-r--r-- | coverage/html.py | 11 | ||||
| -rw-r--r-- | coverage/htmlfiles/pyfile.html | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/coverage/html.py b/coverage/html.py index ada19d9..41901b4 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -61,6 +61,11 @@ class HtmlReporter(Reporter): else: pc_cov = 100.0 + # These classes determine which lines are highlighted by default. + c_run = " run hide" + c_exc = " exc" + c_mis = " mis" + lines = [] for lineno, line in enumerate(source_lines): lineno += 1 # enum is 0-based, lines are 1-based. @@ -70,11 +75,11 @@ class HtmlReporter(Reporter): if lineno in statements: css_class += " stm" if lineno not in missing and lineno not in excluded: - css_class += " run hide" + css_class += c_run if lineno in excluded: - css_class += " exc" + css_class += c_exc if lineno in missing: - css_class += " mis" + css_class += c_mis lineinfo = { 'text': line, diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index c39937b..d4c15c6 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -26,9 +26,9 @@ function toggle_lines(btn, cls) { </h1>
<h2 class='stats'>
{{n_stm}} statements
- <span class='run hide' onclick='toggle_lines(this, "run")'>{{n_run}} run</span>
- <span class='exc' onclick='toggle_lines(this, "exc")'>{{n_exc}} excluded</span>
- <span class='mis' onclick='toggle_lines(this, "mis")'>{{n_mis}} missing</span>
+ <span class='{{c_run.strip}}' onclick='toggle_lines(this, "run")'>{{n_run}} run</span>
+ <span class='{{c_exc.strip}}' onclick='toggle_lines(this, "exc")'>{{n_exc}} excluded</span>
+ <span class='{{c_mis.strip}}' onclick='toggle_lines(this, "mis")'>{{n_mis}} missing</span>
</h2>
</div>
</div>
|
