4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to show raw code metrics. |
7 Module implementing a dialog to show raw code metrics. |
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 |
230 self.checkProgressLabel.setVisible(len(self.files) > 1) |
223 self.checkProgressLabel.setVisible(len(self.files) > 1) |
231 QApplication.processEvents() |
224 QApplication.processEvents() |
232 |
225 |
233 # now go through all the files |
226 # now go through all the files |
234 self.progress = 0 |
227 self.progress = 0 |
235 if len(self.files) == 1 or not self.radonService.hasBatch: |
228 if len(self.files) == 1: |
236 self.__batch = False |
229 self.__batch = False |
237 self.rawMetrics() |
230 self.rawMetrics() |
238 else: |
231 else: |
239 self.__batch = True |
232 self.__batch = True |
240 self.rawMetricsBatch() |
233 self.rawMetricsBatch() |
484 Private slot to start a code metrics run. |
477 Private slot to start a code metrics run. |
485 """ |
478 """ |
486 fileList = self.__fileList[:] |
479 fileList = self.__fileList[:] |
487 |
480 |
488 filterString = self.excludeFilesEdit.text() |
481 filterString = self.excludeFilesEdit.text() |
489 if "ExcludeFiles" not in self.__data or \ |
482 if ( |
490 filterString != self.__data["ExcludeFiles"]: |
483 "ExcludeFiles" not in self.__data or |
|
484 filterString != self.__data["ExcludeFiles"] |
|
485 ): |
491 self.__data["ExcludeFiles"] = filterString |
486 self.__data["ExcludeFiles"] = filterString |
492 self.__project.setData( |
487 self.__project.setData( |
493 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data) |
488 "OTHERTOOLSPARMS", "RadonCodeMetrics", self.__data) |
494 filterList = [f.strip() for f in filterString.split(",") |
489 filterList = [f.strip() for f in filterString.split(",") |
495 if f.strip()] |
490 if f.strip()] |
496 if filterList: |
491 if filterList: |
497 for fileFilter in filterList: |
492 for fileFilter in filterList: |
498 fileList = \ |
493 fileList = [f for f in fileList |
499 [f for f in fileList if not fnmatch.fnmatch(f, fileFilter)] |
494 if not fnmatch.fnmatch(f, fileFilter)] |
500 |
495 |
501 self.start(fileList) |
496 self.start(fileList) |
502 |
497 |
503 def clear(self): |
498 def clear(self): |
504 """ |
499 """ |