82 self.coverage = cov |
82 self.coverage = cov |
83 self.config = self.coverage.config |
83 self.config = self.coverage.config |
84 data = self.coverage.get_data() |
84 data = self.coverage.get_data() |
85 self.has_arcs = data.has_arcs() |
85 self.has_arcs = data.has_arcs() |
86 if self.config.show_contexts: |
86 if self.config.show_contexts: |
87 if data.measured_contexts() == set([""]): |
87 if data.measured_contexts() == {""}: |
88 self.coverage._warn("No contexts were measured") |
88 self.coverage._warn("No contexts were measured") |
89 data.set_query_contexts(self.config.report_contexts) |
89 data.set_query_contexts(self.config.report_contexts) |
90 |
90 |
91 def data_for_file(self, fr, analysis): |
91 def data_for_file(self, fr, analysis): |
92 """Produce the data needed for one file's report.""" |
92 """Produce the data needed for one file's report.""" |
171 |
171 |
172 def __init__(self, cov): |
172 def __init__(self, cov): |
173 self.coverage = cov |
173 self.coverage = cov |
174 self.config = self.coverage.config |
174 self.config = self.coverage.config |
175 self.directory = self.config.html_dir |
175 self.directory = self.config.html_dir |
|
176 |
|
177 self.skip_covered = self.config.html_skip_covered |
|
178 if self.skip_covered is None: |
|
179 self.skip_covered = self.config.skip_covered |
|
180 self.skip_empty = self.config.html_skip_empty |
|
181 if self.skip_empty is None: |
|
182 self.skip_empty= self.config.skip_empty |
|
183 |
176 title = self.config.html_title |
184 title = self.config.html_title |
177 if env.PY2: |
185 if env.PY2: |
178 title = title.decode("utf8") |
186 title = title.decode("utf8") |
179 |
187 |
180 if self.config.extra_css: |
188 if self.config.extra_css: |
269 |
277 |
270 # Get the numbers for this file. |
278 # Get the numbers for this file. |
271 nums = analysis.numbers |
279 nums = analysis.numbers |
272 self.all_files_nums.append(nums) |
280 self.all_files_nums.append(nums) |
273 |
281 |
274 if self.config.skip_covered: |
282 if self.skip_covered: |
275 # Don't report on 100% files. |
283 # Don't report on 100% files. |
276 no_missing_lines = (nums.n_missing == 0) |
284 no_missing_lines = (nums.n_missing == 0) |
277 no_missing_branches = (nums.n_partial_branches == 0) |
285 no_missing_branches = (nums.n_partial_branches == 0) |
278 if no_missing_lines and no_missing_branches: |
286 if no_missing_lines and no_missing_branches: |
279 # If there's an existing file, remove it. |
287 # If there's an existing file, remove it. |
280 file_be_gone(html_path) |
288 file_be_gone(html_path) |
281 return |
289 return |
282 |
290 |
283 if self.config.skip_empty: |
291 if self.skip_empty: |
284 # Don't report on empty files. |
292 # Don't report on empty files. |
285 if nums.n_statements == 0: |
293 if nums.n_statements == 0: |
286 file_be_gone(html_path) |
294 file_be_gone(html_path) |
287 return |
295 return |
288 |
296 |