From f6cc3e33810adcdb100a9223971b602bbb46881f Mon Sep 17 00:00:00 2001 From: Jon Chappell Date: Mon, 13 Apr 2015 12:42:46 -0400 Subject: Convert single quoted html output to use double quotes. --- coverage/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 2a9e0d1..d4a2229 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -221,7 +221,7 @@ class HtmlReporter(Reporter): else: tok_html = escape(tok_text) or ' ' html.append( - "%s" % (tok_type, tok_html) + '%s' % (tok_type, tok_html) ) lines.append({ -- cgit v1.2.1 From 61a07dc55be8b5c4028ebafe2e603335349358e2 Mon Sep 17 00:00:00 2001 From: Conrad Ho Date: Tue, 14 Apr 2015 03:54:05 +0800 Subject: Ticket299: add time stamp to index.html reports page --- coverage/html.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 2a9e0d1..92ca3f1 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals +import datetime import json import os import re @@ -261,11 +262,14 @@ class HtmlReporter(Reporter): self.totals = sum(f['nums'] for f in self.files) + time_stamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M') + html = index_tmpl.render({ 'arcs': self.arcs, 'extra_css': self.extra_css, 'files': self.files, 'totals': self.totals, + 'time_stamp': time_stamp, }) self.write_html( -- cgit v1.2.1 From 2a7a4f2161d26eeb898f3deec3f7ce21b0f2f957 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 21 Apr 2015 21:31:58 -0400 Subject: More work on #299 Add the timestamp to the Python output files also. Move the timestamp to the footer. Add Conrad to AUTHORS, and update the CHANGES file. --- coverage/html.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 2748d64..0b2cc25 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -93,6 +93,7 @@ class HtmlReporter(Reporter): self.status = HtmlStatus() self.extra_css = None self.totals = Numbers() + self.time_stamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M') def report(self, morfs): """Generate an HTML report for `morfs`. @@ -238,6 +239,7 @@ class HtmlReporter(Reporter): 'c_exc': c_exc, 'c_mis': c_mis, 'c_par': c_par, 'c_run': c_run, 'arcs': self.arcs, 'extra_css': self.extra_css, 'fr': fr, 'nums': nums, 'lines': lines, + 'time_stamp': self.time_stamp, } html = spaceless(self.source_tmpl.render(template_values)) @@ -262,14 +264,12 @@ class HtmlReporter(Reporter): self.totals = sum(f['nums'] for f in self.files) - time_stamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M') - html = index_tmpl.render({ 'arcs': self.arcs, 'extra_css': self.extra_css, 'files': self.files, 'totals': self.totals, - 'time_stamp': time_stamp, + 'time_stamp': self.time_stamp, }) self.write_html( -- cgit v1.2.1 From dc024f9e185d9de9bfcbd0365f5bfb27284ced18 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 27 May 2015 10:01:26 -0400 Subject: Seems like I don't need unicode literals any more? --- coverage/html.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 0b2cc25..9148f42 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -1,7 +1,5 @@ """HTML reporting for Coverage.""" -from __future__ import unicode_literals - import datetime import json import os -- cgit v1.2.1 From c6dfb5b69d8211fc25aca06dc2c97e492d9b334c Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 28 Jun 2015 22:41:53 +0300 Subject: Make return codes consistent: 1 for no data and 2 for fail_under. Now the `report` command will properly report `No data to report` if there's no data. --- coverage/html.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 9148f42..da23935 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -126,8 +126,7 @@ class HtmlReporter(Reporter): self.index_file() self.make_local_static_report_files() - - return self.totals.pc_covered + return self.totals.n_statements and self.totals.pc_covered def make_local_static_report_files(self): """Make local instances of static files for HTML report.""" -- cgit v1.2.1 From 1dba726d05dcdbd1be7d4b987151d691b0a7c535 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 4 Jul 2015 20:53:13 -0400 Subject: Remove the last vestige of FileReporter.name --- coverage/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index da23935..62c13e2 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -248,7 +248,7 @@ class HtmlReporter(Reporter): index_info = { 'nums': nums, 'html_filename': html_filename, - 'name': fr.name, + 'relative_filename': fr.relative_filename(), } self.files.append(index_info) self.status.set_index_info(flat_rootname, index_info) -- cgit v1.2.1 From dc0d0c613de54cd5af74a1d3ac9d86235dc0aee9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2015 10:43:46 -0400 Subject: Add license mention to the top of all files. #313. --- coverage/html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 62c13e2..9022ac4 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -1,4 +1,7 @@ -"""HTML reporting for Coverage.""" +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + +"""HTML reporting for coverage.py.""" import datetime import json -- cgit v1.2.1