4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing the Exception Logger widget. |
7 Module implementing the Exception Logger widget. |
8 """ |
8 """ |
|
9 |
|
10 import contextlib |
9 |
11 |
10 from PyQt5.QtCore import pyqtSignal, Qt |
12 from PyQt5.QtCore import pyqtSignal, Qt |
11 from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QMenu |
13 from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QMenu |
12 |
14 |
13 from E5Gui.E5Application import e5App |
15 from E5Gui.E5Application import e5App |
139 if itm.parent() is None: |
141 if itm.parent() is None: |
140 return |
142 return |
141 |
143 |
142 entry = itm.text(0) |
144 entry = itm.text(0) |
143 entryList = entry.split(",") |
145 entryList = entry.split(",") |
144 try: |
146 with contextlib.suppress(IndexError, ValueError): |
145 self.sourceFile.emit(entryList[0], int(entryList[1])) |
147 self.sourceFile.emit(entryList[0], int(entryList[1])) |
146 except (IndexError, ValueError): |
148 |
147 pass |
|
148 |
|
149 def __configure(self): |
149 def __configure(self): |
150 """ |
150 """ |
151 Private method to open the configuration dialog. |
151 Private method to open the configuration dialog. |
152 """ |
152 """ |
153 e5App().getObject("UserInterface").showPreferences( |
153 e5App().getObject("UserInterface").showPreferences( |