139 Public method to start a remote Ruby interpreter. |
139 Public method to start a remote Ruby interpreter. |
140 |
140 |
141 @param port portnumber the debug server is listening on (integer) |
141 @param port portnumber the debug server is listening on (integer) |
142 @param runInConsole flag indicating to start the debugger in a |
142 @param runInConsole flag indicating to start the debugger in a |
143 console window (boolean) |
143 console window (boolean) |
144 @return client process object (QProcess) and a flag to indicate |
144 @return client process object (QProcess), a flag to indicate |
145 a network connection (boolean) |
145 a network connection (boolean) and the name of the interpreter |
|
146 in case of a local execution (string) |
146 """ |
147 """ |
147 interpreter = Preferences.getDebugger("RubyInterpreter") |
148 interpreter = Preferences.getDebugger("RubyInterpreter") |
148 if interpreter == "": |
149 if interpreter == "": |
149 E5MessageBox.critical( |
150 E5MessageBox.critical( |
150 None, |
151 None, |
151 self.tr("Start Debugger"), |
152 self.tr("Start Debugger"), |
152 self.tr("""<p>No Ruby interpreter configured.</p>""")) |
153 self.tr("""<p>No Ruby interpreter configured.</p>""")) |
153 return None, False |
154 return None, False, "" |
154 |
155 |
155 debugClient = os.path.join( |
156 debugClient = os.path.join( |
156 getConfig('ericDir'), "DebugClients", "Ruby", "DebugClient.rb") |
157 getConfig('ericDir'), "DebugClients", "Ruby", "DebugClient.rb") |
157 |
158 |
158 redirect = str(Preferences.getDebugger("RubyRedirect")) |
159 redirect = str(Preferences.getDebugger("RubyRedirect")) |
184 self.translateLocal = \ |
185 self.translateLocal = \ |
185 Preferences.getDebugger("PathTranslationLocal") |
186 Preferences.getDebugger("PathTranslationLocal") |
186 self.translate = self.__remoteTranslation |
187 self.translate = self.__remoteTranslation |
187 else: |
188 else: |
188 self.translate = self.__identityTranslation |
189 self.translate = self.__identityTranslation |
189 return process, self.__isNetworked |
190 return process, self.__isNetworked, "" |
190 |
191 |
191 # set translation function |
192 # set translation function |
192 self.translate = self.__identityTranslation |
193 self.translate = self.__identityTranslation |
193 |
194 |
194 # setup the environment for the debugger |
195 # setup the environment for the debugger |
221 None, |
222 None, |
222 self.tr("Start Debugger"), |
223 self.tr("Start Debugger"), |
223 self.tr( |
224 self.tr( |
224 """<p>The debugger backend could not be""" |
225 """<p>The debugger backend could not be""" |
225 """ started.</p>""")) |
226 """ started.</p>""")) |
226 return process, self.__isNetworked |
227 return process, self.__isNetworked, interpreter |
227 |
228 |
228 process = self.__startProcess( |
229 process = self.__startProcess( |
229 interpreter, |
230 interpreter, |
230 [debugClient, str(port), redirect, ipaddr], |
231 [debugClient, str(port), redirect, ipaddr], |
231 clientEnv) |
232 clientEnv) |
233 E5MessageBox.critical( |
234 E5MessageBox.critical( |
234 None, |
235 None, |
235 self.tr("Start Debugger"), |
236 self.tr("Start Debugger"), |
236 self.tr( |
237 self.tr( |
237 """<p>The debugger backend could not be started.</p>""")) |
238 """<p>The debugger backend could not be started.</p>""")) |
238 return process, self.__isNetworked |
239 return process, self.__isNetworked, interpreter |
239 |
240 |
240 def startRemoteForProject(self, port, runInConsole): |
241 def startRemoteForProject(self, port, runInConsole): |
241 """ |
242 """ |
242 Public method to start a remote Ruby interpreter for a project. |
243 Public method to start a remote Ruby interpreter for a project. |
243 |
244 |
244 @param port portnumber the debug server is listening on (integer) |
245 @param port portnumber the debug server is listening on (integer) |
245 @param runInConsole flag indicating to start the debugger in a |
246 @param runInConsole flag indicating to start the debugger in a |
246 console window (boolean) |
247 console window (boolean) |
247 @return pid of the client process (integer) and a flag to indicate |
248 @return client process object (QProcess), a flag to indicate |
248 a network connection (boolean) |
249 a network connection (boolean) and the name of the interpreter |
|
250 in case of a local execution (string) |
249 """ |
251 """ |
250 project = e5App().getObject("Project") |
252 project = e5App().getObject("Project") |
251 if not project.isDebugPropertiesLoaded(): |
253 if not project.isDebugPropertiesLoaded(): |
252 return None, self.__isNetworked |
254 return None, self.__isNetworked, "" |
253 |
255 |
254 # start debugger with project specific settings |
256 # start debugger with project specific settings |
255 interpreter = project.getDebugProperty("INTERPRETER") |
257 interpreter = project.getDebugProperty("INTERPRETER") |
256 debugClient = project.getDebugProperty("DEBUGCLIENT") |
258 debugClient = project.getDebugProperty("DEBUGCLIENT") |
257 |
259 |
283 self.translateLocal = \ |
285 self.translateLocal = \ |
284 project.getDebugProperty("LOCALPATH") |
286 project.getDebugProperty("LOCALPATH") |
285 self.translate = self.__remoteTranslation |
287 self.translate = self.__remoteTranslation |
286 else: |
288 else: |
287 self.translate = self.__identityTranslation |
289 self.translate = self.__identityTranslation |
288 return process, self.__isNetworked |
290 return process, self.__isNetworked, "" |
289 |
291 |
290 # set translation function |
292 # set translation function |
291 self.translate = self.__identityTranslation |
293 self.translate = self.__identityTranslation |
292 |
294 |
293 # setup the environment for the debugger |
295 # setup the environment for the debugger |
321 None, |
323 None, |
322 self.tr("Start Debugger"), |
324 self.tr("Start Debugger"), |
323 self.tr( |
325 self.tr( |
324 """<p>The debugger backend could not be""" |
326 """<p>The debugger backend could not be""" |
325 """ started.</p>""")) |
327 """ started.</p>""")) |
326 return process, self.__isNetworked |
328 return process, self.__isNetworked, interpreter |
327 |
329 |
328 process = self.__startProcess( |
330 process = self.__startProcess( |
329 interpreter, |
331 interpreter, |
330 [debugClient, str(port), redirect, ipaddr], |
332 [debugClient, str(port), redirect, ipaddr], |
331 clientEnv) |
333 clientEnv) |
333 E5MessageBox.critical( |
335 E5MessageBox.critical( |
334 None, |
336 None, |
335 self.tr("Start Debugger"), |
337 self.tr("Start Debugger"), |
336 self.tr( |
338 self.tr( |
337 """<p>The debugger backend could not be started.</p>""")) |
339 """<p>The debugger backend could not be started.</p>""")) |
338 return process, self.__isNetworked |
340 return process, self.__isNetworked, interpreter |
339 |
341 |
340 def getClientCapabilities(self): |
342 def getClientCapabilities(self): |
341 """ |
343 """ |
342 Public method to retrieve the debug clients capabilities. |
344 Public method to retrieve the debug clients capabilities. |
343 |
345 |