summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-09-02 22:06:16 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-09-02 22:06:16 -0400
commit3a7cc512247059017ddd5ced1344578c845c9edd (patch)
treeb9bd7cd406d43154e45fd563ad7c89e05ebd8400 /coverage/html.py
parent26316d5d71e33daadcf6272288fd5a6a7a5e8423 (diff)
downloadpython-coveragepy-git-3a7cc512247059017ddd5ced1344578c845c9edd.tar.gz
Pass config objects around to limit the sprawl of argument lists.
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/coverage/html.py b/coverage/html.py
index a2005f4b..dac4ff96 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -32,19 +32,17 @@ class HtmlReporter(Reporter):
self.files = []
self.arcs = coverage.data.has_arcs()
- def report(self, morfs, directory, omit=None, include=None):
+ def report(self, morfs, config=None):
"""Generate an HTML report for `morfs`.
- `morfs` is a list of modules or filenames. `directory` is where to put
- the HTML files.
-
- See `coverage.report()` for other arguments.
+ `morfs` is a list of modules or filenames. `config` is a
+ CoverageConfig instance.
"""
- assert directory, "must provide a directory for html reporting"
+ assert config.html_dir, "must provide a directory for html reporting"
# Process all the files.
- self.report_files(self.html_file, morfs, directory, omit, include)
+ self.report_files(self.html_file, morfs, config, config.html_dir)
if not self.files:
raise CoverageException("No data to report.")
@@ -59,7 +57,7 @@ class HtmlReporter(Reporter):
]:
shutil.copyfile(
data_filename("htmlfiles/" + static),
- os.path.join(directory, static)
+ os.path.join(self.directory, static)
)
def html_file(self, cu, analysis):