DataViews/PyProfileDialog.py

changeset 3020
542e97d4ecb3
parent 2986
cd4e2cab7eb2
child 3021
801289962f4e
equal deleted inserted replaced
3019:7912530a33e2 3020:542e97d4ecb3
225 """ 225 """
226 self.basename = os.path.splitext(pfn)[0] 226 self.basename = os.path.splitext(pfn)[0]
227 227
228 fname = "{0}.profile".format(self.basename) 228 fname = "{0}.profile".format(self.basename)
229 if not os.path.exists(fname): 229 if not os.path.exists(fname):
230 E5MessageBox.warning(self, 230 E5MessageBox.warning(
231 self,
231 self.trUtf8("Profile Results"), 232 self.trUtf8("Profile Results"),
232 self.trUtf8("""<p>There is no profiling data""" 233 self.trUtf8("""<p>There is no profiling data"""
233 """ available for <b>{0}</b>.</p>""") 234 """ available for <b>{0}</b>.</p>""")
234 .format(pfn)) 235 .format(pfn))
235 self.close() 236 self.close()
237 try: 238 try:
238 f = open(fname, 'rb') 239 f = open(fname, 'rb')
239 self.stats = pickle.load(f) 240 self.stats = pickle.load(f)
240 f.close() 241 f.close()
241 except (EnvironmentError, pickle.PickleError, EOFError): 242 except (EnvironmentError, pickle.PickleError, EOFError):
242 E5MessageBox.critical(self, 243 E5MessageBox.critical(
244 self,
243 self.trUtf8("Loading Profiling Data"), 245 self.trUtf8("Loading Profiling Data"),
244 self.trUtf8("""<p>The profiling data could not be""" 246 self.trUtf8("""<p>The profiling data could not be"""
245 """ read from file <b>{0}</b>.</p>""") 247 """ read from file <b>{0}</b>.</p>""")
246 .format(fname)) 248 .format(fname))
247 self.close() 249 self.close()

eric ide

mercurial