DataViews/PyProfileDialog.py

changeset 3021
801289962f4e
parent 3020
542e97d4ecb3
child 3058
0a02c433f52d
child 3160
209a07d7e401
equal deleted inserted replaced
3020:542e97d4ecb3 3021:801289962f4e
81 self.__menu = QMenu(self) 81 self.__menu = QMenu(self)
82 self.filterItm = self.__menu.addAction( 82 self.filterItm = self.__menu.addAction(
83 self.trUtf8('Exclude Python Library'), 83 self.trUtf8('Exclude Python Library'),
84 self.__filter) 84 self.__filter)
85 self.__menu.addSeparator() 85 self.__menu.addSeparator()
86 self.__menu.addAction(self.trUtf8('Erase Profiling Info'), 86 self.__menu.addAction(
87 self.__eraseProfile) 87 self.trUtf8('Erase Profiling Info'), self.__eraseProfile)
88 self.__menu.addAction(self.trUtf8('Erase Timing Info'), 88 self.__menu.addAction(
89 self.__eraseTiming) 89 self.trUtf8('Erase Timing Info'), self.__eraseTiming)
90 self.__menu.addSeparator() 90 self.__menu.addSeparator()
91 self.__menu.addAction(self.trUtf8('Erase All Infos'), self.__eraseAll) 91 self.__menu.addAction(self.trUtf8('Erase All Infos'), self.__eraseAll)
92 self.resultList.setContextMenuPolicy(Qt.CustomContextMenu) 92 self.resultList.setContextMenuPolicy(Qt.CustomContextMenu)
93 self.resultList.customContextMenuRequested.connect( 93 self.resultList.customContextMenuRequested.connect(
94 self.__showContextMenu) 94 self.__showContextMenu)
168 # now go through all the files 168 # now go through all the files
169 for func, (cc, nc, tt, ct, callers) in list(self.stats.items()): 169 for func, (cc, nc, tt, ct, callers) in list(self.stats.items()):
170 if self.cancelled: 170 if self.cancelled:
171 return 171 return
172 172
173 if not (self.ericpath and 173 if not (self.ericpath and
174 func[0].startswith(self.ericpath)) and \ 174 func[0].startswith(self.ericpath)) and \
175 not func[0].startswith("DebugClients") and \ 175 not func[0].startswith("DebugClients") and \
176 func[0] != "profile" and \ 176 func[0] != "profile" and \
177 not (exclude and ( 177 not (exclude and (
178 func[0].startswith(self.pyLibPath) or func[0] == "")): 178 func[0].startswith(self.pyLibPath) or func[0] == "")):
230 E5MessageBox.warning( 230 E5MessageBox.warning(
231 self, 231 self,
232 self.trUtf8("Profile Results"), 232 self.trUtf8("Profile Results"),
233 self.trUtf8("""<p>There is no profiling data""" 233 self.trUtf8("""<p>There is no profiling data"""
234 """ available for <b>{0}</b>.</p>""") 234 """ available for <b>{0}</b>.</p>""")
235 .format(pfn)) 235 .format(pfn))
236 self.close() 236 self.close()
237 return 237 return
238 try: 238 try:
239 f = open(fname, 'rb') 239 f = open(fname, 'rb')
240 self.stats = pickle.load(f) 240 self.stats = pickle.load(f)
243 E5MessageBox.critical( 243 E5MessageBox.critical(
244 self, 244 self,
245 self.trUtf8("Loading Profiling Data"), 245 self.trUtf8("Loading Profiling Data"),
246 self.trUtf8("""<p>The profiling data could not be""" 246 self.trUtf8("""<p>The profiling data could not be"""
247 """ read from file <b>{0}</b>.</p>""") 247 """ read from file <b>{0}</b>.</p>""")
248 .format(fname)) 248 .format(fname))
249 self.close() 249 self.close()
250 return 250 return
251 251
252 self.file = fn 252 self.file = fn
253 self.__populateLists() 253 self.__populateLists()

eric ide

mercurial