eric6/DataViews/PyProfileDialog.py

changeset 8207
d359172d11be
parent 8143
2c730d5fd177
child 8218
7c09585bd960
equal deleted inserted replaced
8206:adf11836cfce 8207:d359172d11be
161 self.summaryList.clear() 161 self.summaryList.clear()
162 162
163 self.checkProgress.setMaximum(len(self.stats)) 163 self.checkProgress.setMaximum(len(self.stats))
164 QApplication.processEvents() 164 QApplication.processEvents()
165 165
166 progress = 0
167 total_calls = 0 166 total_calls = 0
168 prim_calls = 0 167 prim_calls = 0
169 total_tt = 0 168 total_tt = 0
170 169
171 try: 170 try:
172 # disable updates of the list for speed 171 # disable updates of the list for speed
173 self.resultList.setUpdatesEnabled(False) 172 self.resultList.setUpdatesEnabled(False)
174 self.resultList.setSortingEnabled(False) 173 self.resultList.setSortingEnabled(False)
175 174
176 # now go through all the files 175 # now go through all the files
177 for func, (cc, nc, tt, ct, _callers) in list(self.stats.items()): 176 for progress, (func, (cc, nc, tt, ct, _callers)) in enumerate(
177 list(self.stats.items()), start=1
178 ):
178 if self.cancelled: 179 if self.cancelled:
179 return 180 return
180 181
181 if (not (self.ericpath and 182 if (not (self.ericpath and
182 func[0].startswith(self.ericpath)) and 183 func[0].startswith(self.ericpath)) and
205 else: 206 else:
206 cpc = "{0: 8.3f}".format(ct / cc) 207 cpc = "{0: 8.3f}".format(ct / cc)
207 self.__createResultItem(c, tt, tpc, ct, cpc, func[0], 208 self.__createResultItem(c, tt, tpc, ct, cpc, func[0],
208 func[1], func[2]) 209 func[1], func[2])
209 210
210 progress += 1
211 self.checkProgress.setValue(progress) 211 self.checkProgress.setValue(progress)
212 QApplication.processEvents() 212 QApplication.processEvents()
213 finally: 213 finally:
214 # reenable updates of the list 214 # reenable updates of the list
215 self.resultList.setSortingEnabled(True) 215 self.resultList.setSortingEnabled(True)

eric ide

mercurial