diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-22 08:10:32 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-22 08:10:32 -0500 |
commit | 22f3e364c92776a0f10d1fb12b3dd8e685cb3293 (patch) | |
tree | a5d7edbe2e879bd8b6f0e1a68d89be47fe7a71e0 /coverage/annotate.py | |
parent | b6a6dd3f9c2411b4dea4110fac0fcad4ec9b6d7d (diff) | |
download | python-coveragepy-22f3e364c92776a0f10d1fb12b3dd8e685cb3293.tar.gz |
Remove every last trace of CodeUnit, and bring me a glass of vodka
Diffstat (limited to 'coverage/annotate.py')
-rw-r--r-- | coverage/annotate.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/annotate.py b/coverage/annotate.py index 3487feb..b77df4e 100644 --- a/coverage/annotate.py +++ b/coverage/annotate.py @@ -41,10 +41,10 @@ class AnnotateReporter(Reporter): """ self.report_files(self.annotate_file, morfs, directory) - def annotate_file(self, cu, analysis): + def annotate_file(self, fr, analysis): """Annotate a single file. - `cu` is the CodeUnit for the file to annotate. + `fr` is the FileReporter for the file to annotate. """ statements = sorted(analysis.statements) @@ -52,18 +52,18 @@ class AnnotateReporter(Reporter): excluded = sorted(analysis.excluded) if self.directory: - dest_file = os.path.join(self.directory, cu.flat_rootname()) + dest_file = os.path.join(self.directory, fr.flat_rootname()) if dest_file.endswith("_py"): dest_file = dest_file[:-3] + ".py" dest_file += ",cover" else: - dest_file = cu.filename + ",cover" + dest_file = fr.filename + ",cover" with open(dest_file, 'w') as dest: i = 0 j = 0 covered = True - source = cu.source() + source = fr.source() for lineno, line in enumerate(source.splitlines(True), start=1): while i < len(statements) and statements[i] < lineno: i += 1 |