RadonMetrics/CyclomaticComplexityDialog.py

changeset 29
2fcc4e8791c8
parent 24
edaf153da771
child 31
fe59ed68bd19
equal deleted inserted replaced
28:8a5e8df57aef 29:2fcc4e8791c8
232 232
233 self.__data = self.__project.getData( 233 self.__data = self.__project.getData(
234 "OTHERTOOLSPARMS", "RadonCodeMetrics") 234 "OTHERTOOLSPARMS", "RadonCodeMetrics")
235 if self.__data is None or "ExcludeFiles" not in self.__data: 235 if self.__data is None or "ExcludeFiles" not in self.__data:
236 self.__data = {"ExcludeFiles": ""} 236 self.__data = {"ExcludeFiles": ""}
237 if "MinimumRank" not in self.__data:
238 self.__data["MinimumRank"] = "D"
237 self.excludeFilesEdit.setText(self.__data["ExcludeFiles"]) 239 self.excludeFilesEdit.setText(self.__data["ExcludeFiles"])
240 self.__minimumRank = self.__data["MinimumRank"]
241 self.rankComboBox.setCurrentText(self.__minimumRank)
238 242
239 def start(self, fn, minRank="D"): 243 def start(self, fn, minRank="D"):
240 """ 244 """
241 Public slot to start the cyclomatic complexity determination. 245 Public slot to start the cyclomatic complexity determination.
242 246
530 def on_startButton_clicked(self): 534 def on_startButton_clicked(self):
531 """ 535 """
532 Private slot to start a cyclomatic complexity run. 536 Private slot to start a cyclomatic complexity run.
533 """ 537 """
534 fileList = self.__fileList[:] 538 fileList = self.__fileList[:]
539 dataChanged = False
535 540
536 filterString = self.excludeFilesEdit.text() 541 filterString = self.excludeFilesEdit.text()
537 if "ExcludeFiles" not in self.__data or \ 542 if "ExcludeFiles" not in self.__data or \
538 filterString != self.__data["ExcludeFiles"]: 543 filterString != self.__data["ExcludeFiles"]:
539 self.__data["ExcludeFiles"] = filterString 544 self.__data["ExcludeFiles"] = filterString
540 self.__project.setData( 545 dataChanged = True
541 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data)
542 filterList = [f.strip() for f in filterString.split(",") 546 filterList = [f.strip() for f in filterString.split(",")
543 if f.strip()] 547 if f.strip()]
544 if filterList: 548 if filterList:
545 for filter in filterList: 549 for filter in filterList:
546 fileList = \ 550 fileList = \
547 [f for f in fileList if not fnmatch.fnmatch(f, filter)] 551 [f for f in fileList if not fnmatch.fnmatch(f, filter)]
548 552
549 self.start(fileList, minRank=self.rankComboBox.currentText()) 553 minimumRank = self.rankComboBox.currentText()
554 if "MinimumRank" not in self.__data or \
555 minimumRank != self.__data["MinimumRank"]:
556 self.__data["MinimumRank"] = minimumRank
557 dataChanged = True
558
559 if dataChanged:
560 self.__project.setData(
561 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data)
562
563 self.start(fileList, minRank=minimumRank)
550 564
551 def __showContextMenu(self, coord): 565 def __showContextMenu(self, coord):
552 """ 566 """
553 Private slot to show the context menu of the resultlist. 567 Private slot to show the context menu of the resultlist.
554 568

eric ide

mercurial