Debugger/DebuggerInterfacePython.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3345
071afe8be2a1
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
155 """ 155 """
156 interpreter = Preferences.getDebugger("PythonInterpreter") 156 interpreter = Preferences.getDebugger("PythonInterpreter")
157 if interpreter == "": 157 if interpreter == "":
158 E5MessageBox.critical( 158 E5MessageBox.critical(
159 None, 159 None,
160 self.trUtf8("Start Debugger"), 160 self.tr("Start Debugger"),
161 self.trUtf8( 161 self.tr(
162 """<p>No Python2 interpreter configured.</p>""")) 162 """<p>No Python2 interpreter configured.</p>"""))
163 return None, False 163 return None, False
164 164
165 debugClientType = Preferences.getDebugger("DebugClientType") 165 debugClientType = Preferences.getDebugger("DebugClientType")
166 if debugClientType == "standard": 166 if debugClientType == "standard":
195 args[0] = Utilities.getExecutablePath(args[0]) 195 args[0] = Utilities.getExecutablePath(args[0])
196 process = self.__startProcess(args[0], args[1:]) 196 process = self.__startProcess(args[0], args[1:])
197 if process is None: 197 if process is None:
198 E5MessageBox.critical( 198 E5MessageBox.critical(
199 None, 199 None,
200 self.trUtf8("Start Debugger"), 200 self.tr("Start Debugger"),
201 self.trUtf8( 201 self.tr(
202 """<p>The debugger backend could not be""" 202 """<p>The debugger backend could not be"""
203 """ started.</p>""")) 203 """ started.</p>"""))
204 204
205 # set translation function 205 # set translation function
206 if Preferences.getDebugger("PathTranslation"): 206 if Preferences.getDebugger("PathTranslation"):
242 args[0] = Utilities.getExecutablePath(args[0]) 242 args[0] = Utilities.getExecutablePath(args[0])
243 process = self.__startProcess(args[0], args[1:], clientEnv) 243 process = self.__startProcess(args[0], args[1:], clientEnv)
244 if process is None: 244 if process is None:
245 E5MessageBox.critical( 245 E5MessageBox.critical(
246 None, 246 None,
247 self.trUtf8("Start Debugger"), 247 self.tr("Start Debugger"),
248 self.trUtf8( 248 self.tr(
249 """<p>The debugger backend could not be""" 249 """<p>The debugger backend could not be"""
250 """ started.</p>""")) 250 """ started.</p>"""))
251 return process, self.__isNetworked 251 return process, self.__isNetworked
252 252
253 process = self.__startProcess( 253 process = self.__startProcess(
255 [debugClient, noencoding, str(port), redirect, ipaddr], 255 [debugClient, noencoding, str(port), redirect, ipaddr],
256 clientEnv) 256 clientEnv)
257 if process is None: 257 if process is None:
258 E5MessageBox.critical( 258 E5MessageBox.critical(
259 None, 259 None,
260 self.trUtf8("Start Debugger"), 260 self.tr("Start Debugger"),
261 self.trUtf8( 261 self.tr(
262 """<p>The debugger backend could not be started.</p>""")) 262 """<p>The debugger backend could not be started.</p>"""))
263 return process, self.__isNetworked 263 return process, self.__isNetworked
264 264
265 def startRemoteForProject(self, port, runInConsole): 265 def startRemoteForProject(self, port, runInConsole):
266 """ 266 """
297 args[0] = Utilities.getExecutablePath(args[0]) 297 args[0] = Utilities.getExecutablePath(args[0])
298 process = self.__startProcess(args[0], args[1:]) 298 process = self.__startProcess(args[0], args[1:])
299 if process is None: 299 if process is None:
300 E5MessageBox.critical( 300 E5MessageBox.critical(
301 None, 301 None,
302 self.trUtf8("Start Debugger"), 302 self.tr("Start Debugger"),
303 self.trUtf8( 303 self.tr(
304 """<p>The debugger backend could not be""" 304 """<p>The debugger backend could not be"""
305 """ started.</p>""")) 305 """ started.</p>"""))
306 # set translation function 306 # set translation function
307 if project.getDebugProperty("PATHTRANSLATION"): 307 if project.getDebugProperty("PATHTRANSLATION"):
308 self.translateRemote = \ 308 self.translateRemote = \
344 args[0] = Utilities.getExecutablePath(args[0]) 344 args[0] = Utilities.getExecutablePath(args[0])
345 process = self.__startProcess(args[0], args[1:], clientEnv) 345 process = self.__startProcess(args[0], args[1:], clientEnv)
346 if process is None: 346 if process is None:
347 E5MessageBox.critical( 347 E5MessageBox.critical(
348 None, 348 None,
349 self.trUtf8("Start Debugger"), 349 self.tr("Start Debugger"),
350 self.trUtf8( 350 self.tr(
351 """<p>The debugger backend could not be""" 351 """<p>The debugger backend could not be"""
352 """ started.</p>""")) 352 """ started.</p>"""))
353 return process, self.__isNetworked 353 return process, self.__isNetworked
354 354
355 process = self.__startProcess( 355 process = self.__startProcess(
357 [debugClient, noencoding, str(port), redirect, ipaddr], 357 [debugClient, noencoding, str(port), redirect, ipaddr],
358 clientEnv) 358 clientEnv)
359 if process is None: 359 if process is None:
360 E5MessageBox.critical( 360 E5MessageBox.critical(
361 None, 361 None,
362 self.trUtf8("Start Debugger"), 362 self.tr("Start Debugger"),
363 self.trUtf8( 363 self.tr(
364 """<p>The debugger backend could not be started.</p>""")) 364 """<p>The debugger backend could not be started.</p>"""))
365 return process, self.__isNetworked 365 return process, self.__isNetworked
366 366
367 def getClientCapabilities(self): 367 def getClientCapabilities(self):
368 """ 368 """
796 796
797 def __askForkTo(self): 797 def __askForkTo(self):
798 """ 798 """
799 Private method to ask the user which branch of a fork to follow. 799 Private method to ask the user which branch of a fork to follow.
800 """ 800 """
801 selections = [self.trUtf8("Parent Process"), 801 selections = [self.tr("Parent Process"),
802 self.trUtf8("Child process")] 802 self.tr("Child process")]
803 res, ok = QInputDialog.getItem( 803 res, ok = QInputDialog.getItem(
804 None, 804 None,
805 self.trUtf8("Client forking"), 805 self.tr("Client forking"),
806 self.trUtf8("Select the fork branch to follow."), 806 self.tr("Select the fork branch to follow."),
807 selections, 807 selections,
808 0, False) 808 0, False)
809 if not ok or res == selections[0]: 809 if not ok or res == selections[0]:
810 self.__sendCommand(DebugProtocol.ResponseForkTo + 'parent\n') 810 self.__sendCommand(DebugProtocol.ResponseForkTo + 'parent\n')
811 else: 811 else:

eric ide

mercurial