eric7/DataViews/PyCoverageDialog.py

branch
unittest
changeset 9091
4231a14a89d7
parent 9084
ee36935f4edd
child 9192
a763d57e23bc
equal deleted inserted replaced
9090:224c634a1808 9091:4231a14a89d7
171 @param cfn basename of the coverage file 171 @param cfn basename of the coverage file
172 @type str 172 @type str
173 @param fn file or list of files or directory to be checked 173 @param fn file or list of files or directory to be checked
174 @type str or list of str 174 @type str or list of str
175 """ 175 """
176 # initialize the dialog
177 self.resultList.clear()
178 self.summaryList.clear()
179 self.cancelled = False
180 self.buttonBox.button(
181 QDialogButtonBox.StandardButton.Close).setEnabled(False)
182 self.buttonBox.button(
183 QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
184 self.buttonBox.button(
185 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
186
176 self.__cfn = cfn 187 self.__cfn = cfn
177 self.__fn = fn 188 self.__fn = fn
178 189
179 self.basename = os.path.splitext(cfn)[0] 190 self.cfn = (
180 191 cfn
181 self.cfn = "{0}.coverage".format(self.basename) 192 if cfn.endswith(".coverage") else
193 "{0}.coverage".format(os.path.splitext(cfn)[0])
194 )
182 195
183 if isinstance(fn, list): 196 if isinstance(fn, list):
184 files = fn 197 files = fn
185 self.path = os.path.dirname(cfn) 198 self.path = os.path.dirname(cfn)
186 elif os.path.isdir(fn): 199 elif os.path.isdir(fn):
439 @pyqtSlot() 452 @pyqtSlot()
440 def on_reloadButton_clicked(self): 453 def on_reloadButton_clicked(self):
441 """ 454 """
442 Private slot to reload the coverage info. 455 Private slot to reload the coverage info.
443 """ 456 """
444 self.resultList.clear()
445 self.summaryList.clear()
446 self.reload = True 457 self.reload = True
447 excludePattern = self.excludeCombo.currentText() 458 excludePattern = self.excludeCombo.currentText()
448 if excludePattern in self.excludeList: 459 if excludePattern in self.excludeList:
449 self.excludeList.remove(excludePattern) 460 self.excludeList.remove(excludePattern)
450 self.excludeList.insert(0, excludePattern) 461 self.excludeList.insert(0, excludePattern)
451 self.cancelled = False
452 self.buttonBox.button(
453 QDialogButtonBox.StandardButton.Close).setEnabled(False)
454 self.buttonBox.button(
455 QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
456 self.buttonBox.button(
457 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
458 self.start(self.__cfn, self.__fn) 462 self.start(self.__cfn, self.__fn)
459 463
460 @pyqtSlot(QTreeWidgetItem, int) 464 @pyqtSlot(QTreeWidgetItem, int)
461 def on_resultList_itemActivated(self, item, column): 465 def on_resultList_itemActivated(self, item, column):
462 """ 466 """

eric ide

mercurial