src/eric7/QScintilla/Shell.py

branch
server
changeset 10633
dda7e43934dc
parent 10632
1109854f15f9
child 10651
280a53840aa3
equal deleted inserted replaced
10632:1109854f15f9 10633:dda7e43934dc
2133 # check, if the cursor is positioned on an exception line 2133 # check, if the cursor is positioned on an exception line
2134 # The exception line looks like 'File: /path/of/file.py, Line: 111'. 2134 # The exception line looks like 'File: /path/of/file.py, Line: 111'.
2135 line = self.getCursorPosition()[0] 2135 line = self.getCursorPosition()[0]
2136 text = self.text(line).strip() 2136 text = self.text(line).strip()
2137 self.__showSourceAct.setEnabled( 2137 self.__showSourceAct.setEnabled(
2138 bool(re.search(r'File: (.*?), Line: (\d+)', text)) 2138 bool(re.search(r"File: (.*?), Line: (\d+)", text))
2139 ) 2139 )
2140 2140
2141 self.menu.popup(self.mapToGlobal(pos)) 2141 self.menu.popup(self.mapToGlobal(pos))
2142 2142
2143 def clear(self): 2143 def clear(self):
2644 ppath = self.__project.getProjectPath() 2644 ppath = self.__project.getProjectPath()
2645 self.dbs.startClient( 2645 self.dbs.startClient(
2646 False, 2646 False,
2647 forProject=True, 2647 forProject=True,
2648 workingDir=ppath, 2648 workingDir=ppath,
2649 startRemote=FileSystemUtilities.isRemoteFileName(ppath) 2649 startRemote=FileSystemUtilities.isRemoteFileName(ppath),
2650 ) 2650 )
2651 self.__currentWorkingDirectory = self.__project.getProjectPath() 2651 self.__currentWorkingDirectory = self.__project.getProjectPath()
2652 self.__getBanner() 2652 self.__getBanner()
2653 2653
2654 def __projectClosed(self): 2654 def __projectClosed(self):
2664 ####################################################################### 2664 #######################################################################
2665 2665
2666 def __showSource(self): 2666 def __showSource(self):
2667 """ 2667 """
2668 Private method to open an editor for an exception line. 2668 Private method to open an editor for an exception line.
2669 2669
2670 Note: The exception line looks like 'File: /path/of/file.py, Line: 111'. 2670 Note: The exception line looks like 'File: /path/of/file.py, Line: 111'.
2671 """ 2671 """
2672 line = self.getCursorPosition()[0] 2672 line = self.getCursorPosition()[0]
2673 text = self.text(line).strip() 2673 text = self.text(line).strip()
2674 match = re.search(r'File: (.*?), Line: (\d+)', text) 2674 match = re.search(r"File: (.*?), Line: (\d+)", text)
2675 if match: 2675 if match:
2676 filename = match.group(1) 2676 filename = match.group(1)
2677 linenumber = int(match.group(2)) 2677 linenumber = int(match.group(2))
2678 self.vm.openSourceFile(filename, lineno=linenumber) 2678 self.vm.openSourceFile(filename, lineno=linenumber)
2679 2679

eric ide

mercurial