145 Public method to start a remote Python interpreter. |
145 Public method to start a remote Python interpreter. |
146 |
146 |
147 @param port portnumber the debug server is listening on (integer) |
147 @param port portnumber the debug server is listening on (integer) |
148 @param runInConsole flag indicating to start the debugger in a |
148 @param runInConsole flag indicating to start the debugger in a |
149 console window (boolean) |
149 console window (boolean) |
150 @return client process object (QProcess) and a flag to indicate |
150 @return client process object (QProcess), a flag to indicate |
151 a network connection (boolean) |
151 a network connection (boolean) and the name of the interpreter |
|
152 in case of a local execution (string) |
152 """ |
153 """ |
153 if Preferences.getDebugger("CustomPython3Interpreter"): |
154 if Preferences.getDebugger("CustomPython3Interpreter"): |
154 interpreter = Preferences.getDebugger("Python3Interpreter") |
155 interpreter = Preferences.getDebugger("Python3Interpreter") |
155 if interpreter == "": |
156 if interpreter == "": |
156 interpreter = sys.executable |
157 interpreter = sys.executable |
204 self.translateLocal = \ |
205 self.translateLocal = \ |
205 Preferences.getDebugger("PathTranslationLocal") |
206 Preferences.getDebugger("PathTranslationLocal") |
206 self.translate = self.__remoteTranslation |
207 self.translate = self.__remoteTranslation |
207 else: |
208 else: |
208 self.translate = self.__identityTranslation |
209 self.translate = self.__identityTranslation |
209 return process, self.__isNetworked |
210 return process, self.__isNetworked, "" |
210 |
211 |
211 # set translation function |
212 # set translation function |
212 self.translate = self.__identityTranslation |
213 self.translate = self.__identityTranslation |
213 |
214 |
214 # setup the environment for the debugger |
215 # setup the environment for the debugger |
241 None, |
242 None, |
242 self.tr("Start Debugger"), |
243 self.tr("Start Debugger"), |
243 self.tr( |
244 self.tr( |
244 """<p>The debugger backend could not be""" |
245 """<p>The debugger backend could not be""" |
245 """ started.</p>""")) |
246 """ started.</p>""")) |
246 return process, self.__isNetworked |
247 return process, self.__isNetworked, interpreter |
247 |
248 |
248 process = self.__startProcess( |
249 process = self.__startProcess( |
249 interpreter, |
250 interpreter, |
250 [debugClient, noencoding, str(port), redirect, ipaddr], |
251 [debugClient, noencoding, str(port), redirect, ipaddr], |
251 clientEnv) |
252 clientEnv) |
253 E5MessageBox.critical( |
254 E5MessageBox.critical( |
254 None, |
255 None, |
255 self.tr("Start Debugger"), |
256 self.tr("Start Debugger"), |
256 self.tr( |
257 self.tr( |
257 """<p>The debugger backend could not be started.</p>""")) |
258 """<p>The debugger backend could not be started.</p>""")) |
258 return process, self.__isNetworked |
259 return process, self.__isNetworked, interpreter |
259 |
260 |
260 def startRemoteForProject(self, port, runInConsole): |
261 def startRemoteForProject(self, port, runInConsole): |
261 """ |
262 """ |
262 Public method to start a remote Python interpreter for a project. |
263 Public method to start a remote Python interpreter for a project. |
263 |
264 |
264 @param port portnumber the debug server is listening on (integer) |
265 @param port portnumber the debug server is listening on (integer) |
265 @param runInConsole flag indicating to start the debugger in a |
266 @param runInConsole flag indicating to start the debugger in a |
266 console window (boolean) |
267 console window (boolean) |
267 @return client process object (QProcess) and a flag to indicate |
268 @return client process object (QProcess), a flag to indicate |
268 a network connection (boolean) |
269 a network connection (boolean) and the name of the interpreter |
|
270 in case of a local execution (string) |
269 """ |
271 """ |
270 project = e5App().getObject("Project") |
272 project = e5App().getObject("Project") |
271 if not project.isDebugPropertiesLoaded(): |
273 if not project.isDebugPropertiesLoaded(): |
272 return None, self.__isNetworked |
274 return None, self.__isNetworked, "" |
273 |
275 |
274 # start debugger with project specific settings |
276 # start debugger with project specific settings |
275 interpreter = project.getDebugProperty("INTERPRETER") |
277 interpreter = project.getDebugProperty("INTERPRETER") |
276 debugClient = project.getDebugProperty("DEBUGCLIENT") |
278 debugClient = project.getDebugProperty("DEBUGCLIENT") |
277 |
279 |
305 self.translateLocal = \ |
307 self.translateLocal = \ |
306 project.getDebugProperty("LOCALPATH") |
308 project.getDebugProperty("LOCALPATH") |
307 self.translate = self.__remoteTranslation |
309 self.translate = self.__remoteTranslation |
308 else: |
310 else: |
309 self.translate = self.__identityTranslation |
311 self.translate = self.__identityTranslation |
310 return process, self.__isNetworked |
312 return process, self.__isNetworked, "" |
311 |
313 |
312 # set translation function |
314 # set translation function |
313 self.translate = self.__identityTranslation |
315 self.translate = self.__identityTranslation |
314 |
316 |
315 # setup the environment for the debugger |
317 # setup the environment for the debugger |
343 None, |
345 None, |
344 self.tr("Start Debugger"), |
346 self.tr("Start Debugger"), |
345 self.tr( |
347 self.tr( |
346 """<p>The debugger backend could not be""" |
348 """<p>The debugger backend could not be""" |
347 """ started.</p>""")) |
349 """ started.</p>""")) |
348 return process, self.__isNetworked |
350 return process, self.__isNetworked, interpreter |
349 |
351 |
350 process = self.__startProcess( |
352 process = self.__startProcess( |
351 interpreter, |
353 interpreter, |
352 [debugClient, noencoding, str(port), redirect, ipaddr], |
354 [debugClient, noencoding, str(port), redirect, ipaddr], |
353 clientEnv) |
355 clientEnv) |
355 E5MessageBox.critical( |
357 E5MessageBox.critical( |
356 None, |
358 None, |
357 self.tr("Start Debugger"), |
359 self.tr("Start Debugger"), |
358 self.tr( |
360 self.tr( |
359 """<p>The debugger backend could not be started.</p>""")) |
361 """<p>The debugger backend could not be started.</p>""")) |
360 return process, self.__isNetworked |
362 return process, self.__isNetworked, interpreter |
361 |
363 |
362 def getClientCapabilities(self): |
364 def getClientCapabilities(self): |
363 """ |
365 """ |
364 Public method to retrieve the debug clients capabilities. |
366 Public method to retrieve the debug clients capabilities. |
365 |
367 |