14 from PyQt6.QtWidgets import ( |
14 from PyQt6.QtWidgets import ( |
15 QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, |
15 QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, |
16 QApplication |
16 QApplication |
17 ) |
17 ) |
18 |
18 |
19 from E5Gui import E5MessageBox |
19 from E5Gui import EricMessageBox |
20 |
20 |
21 from .Ui_PyProfileDialog import Ui_PyProfileDialog |
21 from .Ui_PyProfileDialog import Ui_PyProfileDialog |
22 import Utilities |
22 import Utilities |
23 |
23 |
24 |
24 |
237 """ |
237 """ |
238 self.basename = os.path.splitext(pfn)[0] |
238 self.basename = os.path.splitext(pfn)[0] |
239 |
239 |
240 fname = "{0}.profile".format(self.basename) |
240 fname = "{0}.profile".format(self.basename) |
241 if not os.path.exists(fname): |
241 if not os.path.exists(fname): |
242 E5MessageBox.warning( |
242 EricMessageBox.warning( |
243 self, |
243 self, |
244 self.tr("Profile Results"), |
244 self.tr("Profile Results"), |
245 self.tr("""<p>There is no profiling data""" |
245 self.tr("""<p>There is no profiling data""" |
246 """ available for <b>{0}</b>.</p>""") |
246 """ available for <b>{0}</b>.</p>""") |
247 .format(pfn)) |
247 .format(pfn)) |
249 return |
249 return |
250 try: |
250 try: |
251 with open(fname, 'rb') as f: |
251 with open(fname, 'rb') as f: |
252 self.stats = pickle.load(f) # secok |
252 self.stats = pickle.load(f) # secok |
253 except (OSError, pickle.PickleError, EOFError): |
253 except (OSError, pickle.PickleError, EOFError): |
254 E5MessageBox.critical( |
254 EricMessageBox.critical( |
255 self, |
255 self, |
256 self.tr("Loading Profiling Data"), |
256 self.tr("Loading Profiling Data"), |
257 self.tr("""<p>The profiling data could not be""" |
257 self.tr("""<p>The profiling data could not be""" |
258 """ read from file <b>{0}</b>.</p>""") |
258 """ read from file <b>{0}</b>.</p>""") |
259 .format(fname)) |
259 .format(fname)) |