9 |
9 |
10 import sys |
10 import sys |
11 import os |
11 import os |
12 |
12 |
13 from PyQt4.QtCore import * |
13 from PyQt4.QtCore import * |
14 from PyQt4.QtGui import QInputDialog, QMessageBox |
14 from PyQt4.QtGui import QInputDialog |
15 |
15 |
16 from E5Gui.E5Application import e5App |
16 from E5Gui.E5Application import e5App |
|
17 from E5Gui import E5MessageBox |
17 |
18 |
18 from .DebugProtocol import * |
19 from .DebugProtocol import * |
19 from . import DebugClientCapabilities |
20 from . import DebugClientCapabilities |
20 |
21 |
21 import Preferences |
22 import Preferences |
177 [rhost, interpreter, os.path.abspath(debugClient), |
178 [rhost, interpreter, os.path.abspath(debugClient), |
178 noencoding, str(port), redirect, ipaddr] |
179 noencoding, str(port), redirect, ipaddr] |
179 args[0] = Utilities.getExecutablePath(args[0]) |
180 args[0] = Utilities.getExecutablePath(args[0]) |
180 process = self.__startProcess(args[0], args[1:]) |
181 process = self.__startProcess(args[0], args[1:]) |
181 if process is None: |
182 if process is None: |
182 QMessageBox.critical(None, |
183 E5MessageBox.critical(None, |
183 self.trUtf8("Start Debugger"), |
184 self.trUtf8("Start Debugger"), |
184 self.trUtf8(\ |
185 self.trUtf8(\ |
185 """<p>The debugger backend could not be started.</p>""")) |
186 """<p>The debugger backend could not be started.</p>""")) |
186 |
187 |
187 # set translation function |
188 # set translation function |
222 [interpreter, os.path.abspath(debugClient), |
223 [interpreter, os.path.abspath(debugClient), |
223 noencoding, str(port), '0', ipaddr] |
224 noencoding, str(port), '0', ipaddr] |
224 args[0] = Utilities.getExecutablePath(args[0]) |
225 args[0] = Utilities.getExecutablePath(args[0]) |
225 process = self.__startProcess(args[0], args[1:], clientEnv) |
226 process = self.__startProcess(args[0], args[1:], clientEnv) |
226 if process is None: |
227 if process is None: |
227 QMessageBox.critical(None, |
228 E5MessageBox.critical(None, |
228 self.trUtf8("Start Debugger"), |
229 self.trUtf8("Start Debugger"), |
229 self.trUtf8(\ |
230 self.trUtf8(\ |
230 """<p>The debugger backend could not be started.</p>""")) |
231 """<p>The debugger backend could not be started.</p>""")) |
231 return process, self.__isNetworked |
232 return process, self.__isNetworked |
232 |
233 |
233 process = self.__startProcess(interpreter, |
234 process = self.__startProcess(interpreter, |
234 [debugClient, noencoding, str(port), redirect, ipaddr], |
235 [debugClient, noencoding, str(port), redirect, ipaddr], |
235 clientEnv) |
236 clientEnv) |
236 if process is None: |
237 if process is None: |
237 QMessageBox.critical(None, |
238 E5MessageBox.critical(None, |
238 self.trUtf8("Start Debugger"), |
239 self.trUtf8("Start Debugger"), |
239 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
240 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
240 return process, self.__isNetworked |
241 return process, self.__isNetworked |
241 |
242 |
242 def startRemoteForProject(self, port, runInConsole): |
243 def startRemoteForProject(self, port, runInConsole): |
272 [rhost, interpreter, os.path.abspath(debugClient), |
273 [rhost, interpreter, os.path.abspath(debugClient), |
273 noencoding, str(port), redirect, ipaddr] |
274 noencoding, str(port), redirect, ipaddr] |
274 args[0] = Utilities.getExecutablePath(args[0]) |
275 args[0] = Utilities.getExecutablePath(args[0]) |
275 process = self.__startProcess(args[0], args[1:]) |
276 process = self.__startProcess(args[0], args[1:]) |
276 if process is None: |
277 if process is None: |
277 QMessageBox.critical(None, |
278 E5MessageBox.critical(None, |
278 self.trUtf8("Start Debugger"), |
279 self.trUtf8("Start Debugger"), |
279 self.trUtf8(\ |
280 self.trUtf8(\ |
280 """<p>The debugger backend could not be started.</p>""")) |
281 """<p>The debugger backend could not be started.</p>""")) |
281 # set translation function |
282 # set translation function |
282 if project.getDebugProperty("PATHTRANSLATION"): |
283 if project.getDebugProperty("PATHTRANSLATION"): |
315 [interpreter, os.path.abspath(debugClient), |
316 [interpreter, os.path.abspath(debugClient), |
316 noencoding, str(port), '0', ipaddr] |
317 noencoding, str(port), '0', ipaddr] |
317 args[0] = Utilities.getExecutablePath(args[0]) |
318 args[0] = Utilities.getExecutablePath(args[0]) |
318 process = self.__startProcess(args[0], args[1:], clientEnv) |
319 process = self.__startProcess(args[0], args[1:], clientEnv) |
319 if process is None: |
320 if process is None: |
320 QMessageBox.critical(None, |
321 E5MessageBox.critical(None, |
321 self.trUtf8("Start Debugger"), |
322 self.trUtf8("Start Debugger"), |
322 self.trUtf8(\ |
323 self.trUtf8(\ |
323 """<p>The debugger backend could not be started.</p>""")) |
324 """<p>The debugger backend could not be started.</p>""")) |
324 return process, self.__isNetworked |
325 return process, self.__isNetworked |
325 |
326 |
326 process = self.__startProcess(interpreter, |
327 process = self.__startProcess(interpreter, |
327 [debugClient, noencoding, str(port), redirect, ipaddr], |
328 [debugClient, noencoding, str(port), redirect, ipaddr], |
328 clientEnv) |
329 clientEnv) |
329 if process is None: |
330 if process is None: |
330 QMessageBox.critical(None, |
331 E5MessageBox.critical(None, |
331 self.trUtf8("Start Debugger"), |
332 self.trUtf8("Start Debugger"), |
332 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
333 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
333 return process, self.__isNetworked |
334 return process, self.__isNetworked |
334 |
335 |
335 def getClientCapabilities(self): |
336 def getClientCapabilities(self): |