130 if not proc.waitForStarted(10000): |
130 if not proc.waitForStarted(10000): |
131 proc = None |
131 proc = None |
132 |
132 |
133 return proc |
133 return proc |
134 |
134 |
135 def startRemote(self, port, runInConsole, interpreter): |
135 def startRemote(self, port, runInConsole, venvName): |
136 """ |
136 """ |
137 Public method to start a remote Python interpreter. |
137 Public method to start a remote Python interpreter. |
138 |
138 |
139 @param port port number the debug server is listening on (integer) |
139 @param port port number the debug server is listening on |
|
140 @type int |
140 @param runInConsole flag indicating to start the debugger in a |
141 @param runInConsole flag indicating to start the debugger in a |
141 console window (boolean) |
142 console window |
142 @param interpreter interpreter to be used to execute the remote |
143 @type bool |
143 side (string) |
144 @param venvName name of the virtual environment to be used |
144 @return client process object (QProcess), a flag to indicate |
145 @type str |
145 a network connection (boolean) and the name of the interpreter |
146 @return client process object, a flag to indicate a network connection |
146 in case of a local execution (string) |
147 and the name of the interpreter in case of a local execution |
147 """ |
148 @rtype tuple of (QProcess, bool, str) |
148 if not interpreter: |
149 """ |
|
150 if not venvName: |
149 if self.__variant == "Python2": |
151 if self.__variant == "Python2": |
150 venvName = Preferences.getDebugger("Python2VirtualEnv") |
152 venvName = Preferences.getDebugger("Python2VirtualEnv") |
151 else: |
153 else: |
152 venvName = Preferences.getDebugger("Python3VirtualEnv") |
154 venvName = Preferences.getDebugger("Python3VirtualEnv") |
153 interpreter = e5App().getObject("VirtualEnvManager")\ |
155 interpreter = e5App().getObject("VirtualEnvManager")\ |
266 self.tr("Start Debugger"), |
268 self.tr("Start Debugger"), |
267 self.tr( |
269 self.tr( |
268 """<p>The debugger backend could not be started.</p>""")) |
270 """<p>The debugger backend could not be started.</p>""")) |
269 return process, self.__isNetworked, interpreter |
271 return process, self.__isNetworked, interpreter |
270 |
272 |
271 def startRemoteForProject(self, port, runInConsole, interpreter): |
273 def startRemoteForProject(self, port, runInConsole, venvName): |
272 """ |
274 """ |
273 Public method to start a remote Python interpreter for a project. |
275 Public method to start a remote Python interpreter for a project. |
274 |
276 |
275 @param port port number the debug server is listening on (integer) |
277 @param port port number the debug server is listening on |
|
278 @type int |
276 @param runInConsole flag indicating to start the debugger in a |
279 @param runInConsole flag indicating to start the debugger in a |
277 console window (boolean) |
280 console window |
278 @param interpreter interpreter to be used to execute the remote |
281 @type bool |
279 side (string) |
282 @param venvName name of the virtual environment to be used |
280 @return client process object (QProcess), a flag to indicate |
283 @type str |
281 a network connection (boolean) and the name of the interpreter |
284 @return client process object, a flag to indicate a network connection |
282 in case of a local execution (string) |
285 and the name of the interpreter in case of a local execution |
|
286 @rtype tuple of (QProcess, bool, str) |
283 """ |
287 """ |
284 project = e5App().getObject("Project") |
288 project = e5App().getObject("Project") |
285 if not project.isDebugPropertiesLoaded(): |
289 if not project.isDebugPropertiesLoaded(): |
286 return None, self.__isNetworked, "" |
290 return None, self.__isNetworked, "" |
287 |
291 |
288 # start debugger with project specific settings |
292 # start debugger with project specific settings |
289 if not interpreter: |
293 if not venvName: |
290 interpreter = project.getDebugProperty("INTERPRETER") |
294 venvName = project.getDebugProperty("VIRTUALENV") |
291 debugClient = project.getDebugProperty("DEBUGCLIENT") |
295 debugClient = project.getDebugProperty("DEBUGCLIENT") |
292 |
296 |
293 redirect = str(project.getDebugProperty("REDIRECT")) |
297 redirect = str(project.getDebugProperty("REDIRECT")) |
294 noencoding = \ |
298 noencoding = \ |
295 project.getDebugProperty("NOENCODING") and '--no-encoding' or '' |
299 project.getDebugProperty("NOENCODING") and '--no-encoding' or '' |
|
300 |
|
301 interpreter = e5App().getObject("VirtualEnvManager")\ |
|
302 .getVirtualenvInterpreter(venvName) |
296 |
303 |
297 if project.getDebugProperty("REMOTEDEBUGGER"): |
304 if project.getDebugProperty("REMOTEDEBUGGER"): |
298 ipaddr = self.debugServer.getHostAddress(False) |
305 ipaddr = self.debugServer.getHostAddress(False) |
299 rexec = project.getDebugProperty("REMOTECOMMAND") |
306 rexec = project.getDebugProperty("REMOTECOMMAND") |
300 rhost = project.getDebugProperty("REMOTEHOST") |
307 rhost = project.getDebugProperty("REMOTEHOST") |