16 |
16 |
17 from E5Gui import E5MessageBox |
17 from E5Gui import E5MessageBox |
18 |
18 |
19 from .Ui_PyProfileDialog import Ui_PyProfileDialog |
19 from .Ui_PyProfileDialog import Ui_PyProfileDialog |
20 import Utilities |
20 import Utilities |
21 |
|
22 from eric5config import getConfig |
|
23 |
21 |
24 |
22 |
25 class ProfileTreeWidgetItem(QTreeWidgetItem): |
23 class ProfileTreeWidgetItem(QTreeWidgetItem): |
26 """ |
24 """ |
27 Class implementing a custom QTreeWidgetItem to allow sorting on numeric values. |
25 Class implementing a custom QTreeWidgetItem to allow sorting on numeric values. |
66 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
64 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
67 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
65 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
68 |
66 |
69 self.cancelled = False |
67 self.cancelled = False |
70 self.exclude = True |
68 self.exclude = True |
71 self.ericpath = getConfig('ericDir') |
69 self.ericpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
72 self.pyLibPath = Utilities.getPythonLibPath() |
70 self.pyLibPath = Utilities.getPythonLibPath() |
73 |
71 |
74 self.summaryList.headerItem().setText(self.summaryList.columnCount(), "") |
72 self.summaryList.headerItem().setText(self.summaryList.columnCount(), "") |
75 self.resultList.headerItem().setText(self.resultList.columnCount(), "") |
73 self.resultList.headerItem().setText(self.resultList.columnCount(), "") |
76 self.resultList.header().setSortIndicator(0, Qt.DescendingOrder) |
74 self.resultList.header().setSortIndicator(0, Qt.DescendingOrder) |
160 for func, (cc, nc, tt, ct, callers) in list(self.stats.items()): |
158 for func, (cc, nc, tt, ct, callers) in list(self.stats.items()): |
161 if self.cancelled: |
159 if self.cancelled: |
162 return |
160 return |
163 |
161 |
164 if not (self.ericpath and func[0].startswith(self.ericpath)) and \ |
162 if not (self.ericpath and func[0].startswith(self.ericpath)) and \ |
165 not (exclude and func[0].startswith(self.pyLibPath)): |
163 not func[0].startswith("DebugClients") and \ |
|
164 func[0] != "profile" and \ |
|
165 not (exclude and ( |
|
166 func[0].startswith(self.pyLibPath) or func[0] == "")): |
166 if self.file is None or func[0].startswith(self.file) or \ |
167 if self.file is None or func[0].startswith(self.file) or \ |
167 func[0].startswith(self.pyLibPath): |
168 func[0].startswith(self.pyLibPath): |
168 # calculate the totals |
169 # calculate the totals |
169 total_calls += nc |
170 total_calls += nc |
170 prim_calls += cc |
171 prim_calls += cc |