RadonMetrics/CyclomaticComplexityDialog.py

branch
eric7
changeset 93
1ae73306422a
parent 90
1405e41edc0b
child 94
725eaca7bc4b
equal deleted inserted replaced
92:89a8ab25e056 93:1ae73306422a
326 self.resultList.setUpdatesEnabled(False) 326 self.resultList.setUpdatesEnabled(False)
327 self.resultList.setSortingEnabled(False) 327 self.resultList.setSortingEnabled(False)
328 328
329 self.checkProgress.setMaximum(len(self.files)) 329 self.checkProgress.setMaximum(len(self.files))
330 self.checkProgress.setVisible(len(self.files) > 1) 330 self.checkProgress.setVisible(len(self.files) > 1)
331 self.checkProgressLabel.setVisible(len(self.files) > 1)
332 QApplication.processEvents() 331 QApplication.processEvents()
333 332
334 # now go through all the files 333 # now go through all the files
335 self.progress = 0 334 self.progress = 0
336 if len(self.files) == 1: 335 if len(self.files) == 1:
349 348
350 @param codestring optional sourcestring 349 @param codestring optional sourcestring
351 @type str 350 @type str
352 """ 351 """
353 if not self.files: 352 if not self.files:
354 self.checkProgressLabel.setPath("")
355 self.checkProgress.setMaximum(1) 353 self.checkProgress.setMaximum(1)
356 self.checkProgress.setValue(1) 354 self.checkProgress.setValue(1)
357 self.__finish() 355 self.__finish()
358 return 356 return
359 357
360 self.filename = self.files.pop(0) 358 self.filename = self.files.pop(0)
361 self.checkProgress.setValue(self.progress) 359 self.checkProgress.setValue(self.progress)
362 self.checkProgressLabel.setPath(self.filename)
363 QApplication.processEvents() 360 QApplication.processEvents()
364 361
365 if self.cancelled: 362 if self.cancelled:
366 return 363 return
367 364
385 382
386 The results are reported to the __processResult slot. 383 The results are reported to the __processResult slot.
387 """ 384 """
388 self.__lastFileItem = None 385 self.__lastFileItem = None
389 386
390 self.checkProgressLabel.setPath(self.tr("Preparing files..."))
391
392 argumentsList = [] 387 argumentsList = []
393 for progress, filename in enumerate(self.files, start=1): 388 for progress, filename in enumerate(self.files, start=1):
394 self.checkProgress.setValue(progress) 389 self.checkProgress.setValue(progress)
395 QApplication.processEvents() 390 QApplication.processEvents()
396 391
416 411
417 @param type_ type of the calculated metrics 412 @param type_ type of the calculated metrics
418 @type str, one of ["raw", "mi", "cc"] 413 @type str, one of ["raw", "mi", "cc"]
419 """ 414 """
420 if type_ == "cc": 415 if type_ == "cc":
421 self.checkProgressLabel.setPath("")
422 self.checkProgress.setMaximum(1) 416 self.checkProgress.setMaximum(1)
423 self.checkProgress.setValue(1) 417 self.checkProgress.setValue(1)
424 self.__finish() 418 self.__finish()
425 419
426 def __processError(self, type_, fn, msg): 420 def __processError(self, type_, fn, msg):
453 # Check if it's the requested file, otherwise ignore signal if not 447 # Check if it's the requested file, otherwise ignore signal if not
454 # in batch mode 448 # in batch mode
455 if not self.__batch and fn != self.filename: 449 if not self.__batch and fn != self.filename:
456 return 450 return
457 451
458 self.checkProgressLabel.setPath(self.__project.getRelativePath(fn))
459 QApplication.processEvents() 452 QApplication.processEvents()
460 453
461 if "error" in result: 454 if "error" in result:
462 self.__createErrorItem(fn, result["error"]) 455 self.__createErrorItem(fn, result["error"])
463 else: 456 else:
544 cc_rank(averageCC), 537 cc_rank(averageCC),
545 self.__locale.toString(averageCC, "f", 1) 538 self.__locale.toString(averageCC, "f", 1)
546 )) 539 ))
547 540
548 self.checkProgress.setVisible(False) 541 self.checkProgress.setVisible(False)
549 self.checkProgressLabel.setVisible(False)
550 542
551 @pyqtSlot(QAbstractButton) 543 @pyqtSlot(QAbstractButton)
552 def on_buttonBox_clicked(self, button): 544 def on_buttonBox_clicked(self, button):
553 """ 545 """
554 Private slot called by a button of the button box clicked. 546 Private slot called by a button of the button box clicked.

eric ide

mercurial