4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to show maintainability indexes. |
7 Module implementing a dialog to show maintainability indexes. |
8 """ |
8 """ |
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 try: |
|
13 str = unicode # __IGNORE_EXCEPTION__ __IGNORE_WARNING__ |
|
14 except NameError: |
|
15 pass |
|
16 |
9 |
17 import os |
10 import os |
18 import fnmatch |
11 import fnmatch |
19 |
12 |
20 from PyQt5.QtCore import pyqtSlot, qVersion, Qt, QTimer, QLocale |
13 from PyQt5.QtCore import pyqtSlot, qVersion, Qt, QTimer, QLocale |
216 self.checkProgressLabel.setVisible(len(self.files) > 1) |
209 self.checkProgressLabel.setVisible(len(self.files) > 1) |
217 QApplication.processEvents() |
210 QApplication.processEvents() |
218 |
211 |
219 # now go through all the files |
212 # now go through all the files |
220 self.progress = 0 |
213 self.progress = 0 |
221 if len(self.files) == 1 or not self.radonService.hasBatch: |
214 if len(self.files) == 1: |
222 self.__batch = False |
215 self.__batch = False |
223 self.maintainabilityIndex() |
216 self.maintainabilityIndex() |
224 else: |
217 else: |
225 self.__batch = True |
218 self.__batch = True |
226 self.maintainabilityIndexBatch() |
219 self.maintainabilityIndexBatch() |
422 Private slot to start a maintainability index run. |
415 Private slot to start a maintainability index run. |
423 """ |
416 """ |
424 fileList = self.__fileList[:] |
417 fileList = self.__fileList[:] |
425 |
418 |
426 filterString = self.excludeFilesEdit.text() |
419 filterString = self.excludeFilesEdit.text() |
427 if "ExcludeFiles" not in self.__data or \ |
420 if ( |
428 filterString != self.__data["ExcludeFiles"]: |
421 "ExcludeFiles" not in self.__data or |
|
422 filterString != self.__data["ExcludeFiles"] |
|
423 ): |
429 self.__data["ExcludeFiles"] = filterString |
424 self.__data["ExcludeFiles"] = filterString |
430 self.__project.setData( |
425 self.__project.setData( |
431 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data) |
426 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data) |
432 filterList = [f.strip() for f in filterString.split(",") |
427 filterList = [f.strip() for f in filterString.split(",") |
433 if f.strip()] |
428 if f.strip()] |
434 if filterList: |
429 if filterList: |
435 for fileFilter in filterList: |
430 for fileFilter in filterList: |
436 fileList = \ |
431 fileList = [f for f in fileList |
437 [f for f in fileList if not fnmatch.fnmatch(f, fileFilter)] |
432 if not fnmatch.fnmatch(f, fileFilter)] |
438 |
433 |
439 self.start(fileList) |
434 self.start(fileList) |
440 |
435 |
441 def clear(self): |
436 def clear(self): |
442 """ |
437 """ |