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 |
142 @return client process object (QProcess) and a flag to indicate |
143 @return client process object (QProcess) and a flag to indicate |
143 a network connection (boolean) |
144 a network connection (boolean) |
144 """ |
145 """ |
145 interpreter = Preferences.getDebugger("PythonInterpreter") |
146 interpreter = Preferences.getDebugger("PythonInterpreter") |
146 if interpreter == "": |
147 if interpreter == "": |
147 QMessageBox.critical(None, |
148 E5MessageBox.critical(None, |
148 self.trUtf8("Start Debugger"), |
149 self.trUtf8("Start Debugger"), |
149 self.trUtf8(\ |
150 self.trUtf8(\ |
150 """<p>No Python2 interpreter configured.</p>""")) |
151 """<p>No Python2 interpreter configured.</p>""")) |
151 return None, False |
152 return None, False |
152 |
153 |
178 [rhost, interpreter, os.path.abspath(debugClient), |
179 [rhost, interpreter, os.path.abspath(debugClient), |
179 noencoding, str(port), redirect, ipaddr] |
180 noencoding, str(port), redirect, ipaddr] |
180 args[0] = Utilities.getExecutablePath(args[0]) |
181 args[0] = Utilities.getExecutablePath(args[0]) |
181 process = self.__startProcess(args[0], args[1:]) |
182 process = self.__startProcess(args[0], args[1:]) |
182 if process is None: |
183 if process is None: |
183 QMessageBox.critical(None, |
184 E5MessageBox.critical(None, |
184 self.trUtf8("Start Debugger"), |
185 self.trUtf8("Start Debugger"), |
185 self.trUtf8(\ |
186 self.trUtf8(\ |
186 """<p>The debugger backend could not be started.</p>""")) |
187 """<p>The debugger backend could not be started.</p>""")) |
187 |
188 |
188 # set translation function |
189 # set translation function |
223 [interpreter, os.path.abspath(debugClient), |
224 [interpreter, os.path.abspath(debugClient), |
224 noencoding, str(port), '0', ipaddr] |
225 noencoding, str(port), '0', ipaddr] |
225 args[0] = Utilities.getExecutablePath(args[0]) |
226 args[0] = Utilities.getExecutablePath(args[0]) |
226 process = self.__startProcess(args[0], args[1:], clientEnv) |
227 process = self.__startProcess(args[0], args[1:], clientEnv) |
227 if process is None: |
228 if process is None: |
228 QMessageBox.critical(None, |
229 E5MessageBox.critical(None, |
229 self.trUtf8("Start Debugger"), |
230 self.trUtf8("Start Debugger"), |
230 self.trUtf8(\ |
231 self.trUtf8(\ |
231 """<p>The debugger backend could not be started.</p>""")) |
232 """<p>The debugger backend could not be started.</p>""")) |
232 return process, self.__isNetworked |
233 return process, self.__isNetworked |
233 |
234 |
234 process = self.__startProcess(interpreter, |
235 process = self.__startProcess(interpreter, |
235 [debugClient, noencoding, str(port), redirect, ipaddr], |
236 [debugClient, noencoding, str(port), redirect, ipaddr], |
236 clientEnv) |
237 clientEnv) |
237 if process is None: |
238 if process is None: |
238 QMessageBox.critical(None, |
239 E5MessageBox.critical(None, |
239 self.trUtf8("Start Debugger"), |
240 self.trUtf8("Start Debugger"), |
240 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
241 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
241 return process, self.__isNetworked |
242 return process, self.__isNetworked |
242 |
243 |
243 def startRemoteForProject(self, port, runInConsole): |
244 def startRemoteForProject(self, port, runInConsole): |
273 [rhost, interpreter, os.path.abspath(debugClient), |
274 [rhost, interpreter, os.path.abspath(debugClient), |
274 noencoding, str(port), redirect, ipaddr] |
275 noencoding, str(port), redirect, ipaddr] |
275 args[0] = Utilities.getExecutablePath(args[0]) |
276 args[0] = Utilities.getExecutablePath(args[0]) |
276 process = self.__startProcess(args[0], args[1:]) |
277 process = self.__startProcess(args[0], args[1:]) |
277 if process is None: |
278 if process is None: |
278 QMessageBox.critical(None, |
279 E5MessageBox.critical(None, |
279 self.trUtf8("Start Debugger"), |
280 self.trUtf8("Start Debugger"), |
280 self.trUtf8(\ |
281 self.trUtf8(\ |
281 """<p>The debugger backend could not be started.</p>""")) |
282 """<p>The debugger backend could not be started.</p>""")) |
282 # set translation function |
283 # set translation function |
283 if project.getDebugProperty("PATHTRANSLATION"): |
284 if project.getDebugProperty("PATHTRANSLATION"): |
316 [interpreter, os.path.abspath(debugClient), |
317 [interpreter, os.path.abspath(debugClient), |
317 noencoding, str(port), '0', ipaddr] |
318 noencoding, str(port), '0', ipaddr] |
318 args[0] = Utilities.getExecutablePath(args[0]) |
319 args[0] = Utilities.getExecutablePath(args[0]) |
319 process = self.__startProcess(args[0], args[1:], clientEnv) |
320 process = self.__startProcess(args[0], args[1:], clientEnv) |
320 if process is None: |
321 if process is None: |
321 QMessageBox.critical(None, |
322 E5MessageBox.critical(None, |
322 self.trUtf8("Start Debugger"), |
323 self.trUtf8("Start Debugger"), |
323 self.trUtf8(\ |
324 self.trUtf8(\ |
324 """<p>The debugger backend could not be started.</p>""")) |
325 """<p>The debugger backend could not be started.</p>""")) |
325 return process, self.__isNetworked |
326 return process, self.__isNetworked |
326 |
327 |
327 process = self.__startProcess(interpreter, |
328 process = self.__startProcess(interpreter, |
328 [debugClient, noencoding, str(port), redirect, ipaddr], |
329 [debugClient, noencoding, str(port), redirect, ipaddr], |
329 clientEnv) |
330 clientEnv) |
330 if process is None: |
331 if process is None: |
331 QMessageBox.critical(None, |
332 E5MessageBox.critical(None, |
332 self.trUtf8("Start Debugger"), |
333 self.trUtf8("Start Debugger"), |
333 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
334 self.trUtf8("""<p>The debugger backend could not be started.</p>""")) |
334 return process, self.__isNetworked |
335 return process, self.__isNetworked |
335 |
336 |
336 def getClientCapabilities(self): |
337 def getClientCapabilities(self): |