eric6/DataViews/CodeMetricsDialog.py

changeset 8207
d359172d11be
parent 8147
99c7da0ab9d2
child 8218
7c09585bd960
equal deleted inserted replaced
8206:adf11836cfce 8207:d359172d11be
167 QApplication.processEvents() 167 QApplication.processEvents()
168 168
169 total = collections.defaultdict(int) 169 total = collections.defaultdict(int)
170 CodeMetrics.summarize(total, 'files', len(files)) 170 CodeMetrics.summarize(total, 'files', len(files))
171 171
172 progress = 0
173
174 try: 172 try:
175 # disable updates of the list for speed 173 # disable updates of the list for speed
176 self.resultList.setUpdatesEnabled(False) 174 self.resultList.setUpdatesEnabled(False)
177 self.resultList.setSortingEnabled(False) 175 self.resultList.setSortingEnabled(False)
178 176
179 # now go through all the files 177 # now go through all the files
180 for file in files: 178 for progress, file in enumerate(files, start=1):
181 if self.cancelled: 179 if self.cancelled:
182 return 180 return
183 181
184 stats = CodeMetrics.analyze(file, total) 182 stats = CodeMetrics.analyze(file, total)
185 183
191 v = self.__getValues(loc, stats, identifier) 189 v = self.__getValues(loc, stats, identifier)
192 190
193 self.__createResultItem(fitm, [identifier] + v) 191 self.__createResultItem(fitm, [identifier] + v)
194 self.resultList.expandItem(fitm) 192 self.resultList.expandItem(fitm)
195 193
196 progress += 1
197 self.checkProgress.setValue(progress) 194 self.checkProgress.setValue(progress)
198 QApplication.processEvents() 195 QApplication.processEvents()
199 finally: 196 finally:
200 # reenable updates of the list 197 # reenable updates of the list
201 self.resultList.setSortingEnabled(True) 198 self.resultList.setSortingEnabled(True)

eric ide

mercurial