2126 # check, if the cursor is positioned on an exception line |
2126 # check, if the cursor is positioned on an exception line |
2127 # The exception line looks like 'File: /path/of/file.py, Line: 111'. |
2127 # The exception line looks like 'File: /path/of/file.py, Line: 111'. |
2128 line = self.getCursorPosition()[0] |
2128 line = self.getCursorPosition()[0] |
2129 text = self.text(line).strip() |
2129 text = self.text(line).strip() |
2130 self.__showSourceAct.setEnabled( |
2130 self.__showSourceAct.setEnabled( |
2131 bool(re.search(r'File: (.*?), Line: (\d+)', text)) |
2131 bool(re.search(r"File: (.*?), Line: (\d+)", text)) |
2132 ) |
2132 ) |
2133 |
2133 |
2134 self.menu.popup(self.mapToGlobal(pos)) |
2134 self.menu.popup(self.mapToGlobal(pos)) |
2135 |
2135 |
2136 def clear(self): |
2136 def clear(self): |
2651 ####################################################################### |
2651 ####################################################################### |
2652 |
2652 |
2653 def __showSource(self): |
2653 def __showSource(self): |
2654 """ |
2654 """ |
2655 Private method to open an editor for an exception line. |
2655 Private method to open an editor for an exception line. |
2656 |
2656 |
2657 Note: The exception line looks like 'File: /path/of/file.py, Line: 111'. |
2657 Note: The exception line looks like 'File: /path/of/file.py, Line: 111'. |
2658 """ |
2658 """ |
2659 line = self.getCursorPosition()[0] |
2659 line = self.getCursorPosition()[0] |
2660 text = self.text(line).strip() |
2660 text = self.text(line).strip() |
2661 match = re.search(r'File: (.*?), Line: (\d+)', text) |
2661 match = re.search(r"File: (.*?), Line: (\d+)", text) |
2662 if match: |
2662 if match: |
2663 filename = match.group(1) |
2663 filename = match.group(1) |
2664 linenumber = int(match.group(2)) |
2664 linenumber = int(match.group(2)) |
2665 self.vm.openSourceFile(filename, lineno=linenumber) |
2665 self.vm.openSourceFile(filename, lineno=linenumber) |
|
2666 |
|
2667 |
2666 # |
2668 # |
2667 # eflag: noqa = M601 |
2669 # eflag: noqa = M601 |