184 total_statements = 0 |
184 total_statements = 0 |
185 total_executed = 0 |
185 total_executed = 0 |
186 total_exceptions = 0 |
186 total_exceptions = 0 |
187 |
187 |
188 cover.exclude(self.excludeList[0]) |
188 cover.exclude(self.excludeList[0]) |
189 progress = 0 |
|
190 |
189 |
191 try: |
190 try: |
192 # disable updates of the list for speed |
191 # disable updates of the list for speed |
193 self.resultList.setUpdatesEnabled(False) |
192 self.resultList.setUpdatesEnabled(False) |
194 self.resultList.setSortingEnabled(False) |
193 self.resultList.setSortingEnabled(False) |
195 |
194 |
196 # now go through all the files |
195 # now go through all the files |
197 for file in files: |
196 for progress, file in enumerate(files, start=1): |
198 if self.cancelled: |
197 if self.cancelled: |
199 return |
198 return |
200 |
199 |
201 try: |
200 try: |
202 statements, excluded, missing, readable = ( |
201 statements, excluded, missing, readable = ( |
215 total_statements = total_statements + n |
214 total_statements = total_statements + n |
216 total_executed = total_executed + m |
215 total_executed = total_executed + m |
217 except CoverageException: |
216 except CoverageException: |
218 total_exceptions += 1 |
217 total_exceptions += 1 |
219 |
218 |
220 progress += 1 |
|
221 self.checkProgress.setValue(progress) |
219 self.checkProgress.setValue(progress) |
222 QApplication.processEvents() |
220 QApplication.processEvents() |
223 finally: |
221 finally: |
224 # reenable updates of the list |
222 # reenable updates of the list |
225 self.resultList.setSortingEnabled(True) |
223 self.resultList.setSortingEnabled(True) |
357 progress = E5ProgressDialog( |
355 progress = E5ProgressDialog( |
358 self.tr("Annotating files..."), self.tr("Abort"), |
356 self.tr("Annotating files..."), self.tr("Abort"), |
359 0, len(files), self.tr("%v/%m Files"), self) |
357 0, len(files), self.tr("%v/%m Files"), self) |
360 progress.setMinimumDuration(0) |
358 progress.setMinimumDuration(0) |
361 progress.setWindowTitle(self.tr("Coverage")) |
359 progress.setWindowTitle(self.tr("Coverage")) |
362 count = 0 |
360 |
363 |
361 for count, file in enumerate(files): |
364 for file in files: |
|
365 progress.setValue(count) |
362 progress.setValue(count) |
366 if progress.wasCanceled(): |
363 if progress.wasCanceled(): |
367 break |
364 break |
368 cover.annotate([file], None) # , True) |
365 cover.annotate([file], None) # , True) |
369 count += 1 |
|
370 |
366 |
371 progress.setValue(len(files)) |
367 progress.setValue(len(files)) |
372 |
368 |
373 def __erase(self): |
369 def __erase(self): |
374 """ |
370 """ |