Debugger/DebuggerInterfacePython3.py

changeset 564
b3d966393ba9
parent 537
72b32daeb8d6
child 791
9ec2ac20e54e
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
180 args[0] = Utilities.getExecutablePath(args[0]) 180 args[0] = Utilities.getExecutablePath(args[0])
181 process = self.__startProcess(args[0], args[1:]) 181 process = self.__startProcess(args[0], args[1:])
182 if process is None: 182 if process is None:
183 E5MessageBox.critical(None, 183 E5MessageBox.critical(None,
184 self.trUtf8("Start Debugger"), 184 self.trUtf8("Start Debugger"),
185 self.trUtf8(\ 185 self.trUtf8(
186 """<p>The debugger backend could not be started.</p>""")) 186 """<p>The debugger backend could not be started.</p>"""))
187 187
188 # set translation function 188 # set translation function
189 if Preferences.getDebugger("PathTranslation"): 189 if Preferences.getDebugger("PathTranslation"):
190 self.translateRemote = \ 190 self.translateRemote = \
202 # setup the environment for the debugger 202 # setup the environment for the debugger
203 if Preferences.getDebugger("DebugEnvironmentReplace"): 203 if Preferences.getDebugger("DebugEnvironmentReplace"):
204 clientEnv = {} 204 clientEnv = {}
205 else: 205 else:
206 clientEnv = os.environ.copy() 206 clientEnv = os.environ.copy()
207 envlist = Utilities.parseEnvironmentString(\ 207 envlist = Utilities.parseEnvironmentString(
208 Preferences.getDebugger("DebugEnvironment")) 208 Preferences.getDebugger("DebugEnvironment"))
209 for el in envlist: 209 for el in envlist:
210 try: 210 try:
211 key, value = el.split('=', 1) 211 key, value = el.split('=', 1)
212 if value.startswith('"') or value.startswith("'"): 212 if value.startswith('"') or value.startswith("'"):
225 args[0] = Utilities.getExecutablePath(args[0]) 225 args[0] = Utilities.getExecutablePath(args[0])
226 process = self.__startProcess(args[0], args[1:], clientEnv) 226 process = self.__startProcess(args[0], args[1:], clientEnv)
227 if process is None: 227 if process is None:
228 E5MessageBox.critical(None, 228 E5MessageBox.critical(None,
229 self.trUtf8("Start Debugger"), 229 self.trUtf8("Start Debugger"),
230 self.trUtf8(\ 230 self.trUtf8(
231 """<p>The debugger backend could not be started.</p>""")) 231 """<p>The debugger backend could not be started.</p>"""))
232 return process, self.__isNetworked 232 return process, self.__isNetworked
233 233
234 process = self.__startProcess(interpreter, 234 process = self.__startProcess(interpreter,
235 [debugClient, noencoding, str(port), redirect, ipaddr], 235 [debugClient, noencoding, str(port), redirect, ipaddr],
275 args[0] = Utilities.getExecutablePath(args[0]) 275 args[0] = Utilities.getExecutablePath(args[0])
276 process = self.__startProcess(args[0], args[1:]) 276 process = self.__startProcess(args[0], args[1:])
277 if process is None: 277 if process is None:
278 E5MessageBox.critical(None, 278 E5MessageBox.critical(None,
279 self.trUtf8("Start Debugger"), 279 self.trUtf8("Start Debugger"),
280 self.trUtf8(\ 280 self.trUtf8(
281 """<p>The debugger backend could not be started.</p>""")) 281 """<p>The debugger backend could not be started.</p>"""))
282 # set translation function 282 # set translation function
283 if project.getDebugProperty("PATHTRANSLATION"): 283 if project.getDebugProperty("PATHTRANSLATION"):
284 self.translateRemote = project.getDebugProperty("REMOTEPATH") 284 self.translateRemote = project.getDebugProperty("REMOTEPATH")
285 self.translateLocal = project.getDebugProperty("LOCALPATH") 285 self.translateLocal = project.getDebugProperty("LOCALPATH")
294 # setup the environment for the debugger 294 # setup the environment for the debugger
295 if project.getDebugProperty("ENVIRONMENTOVERRIDE"): 295 if project.getDebugProperty("ENVIRONMENTOVERRIDE"):
296 clientEnv = {} 296 clientEnv = {}
297 else: 297 else:
298 clientEnv = os.environ.copy() 298 clientEnv = os.environ.copy()
299 envlist = Utilities.parseEnvironmentString(\ 299 envlist = Utilities.parseEnvironmentString(
300 project.getDebugProperty("ENVIRONMENTSTRING")) 300 project.getDebugProperty("ENVIRONMENTSTRING"))
301 for el in envlist: 301 for el in envlist:
302 try: 302 try:
303 key, value = el.split('=', 1) 303 key, value = el.split('=', 1)
304 if value.startswith('"') or value.startswith("'"): 304 if value.startswith('"') or value.startswith("'"):
318 args[0] = Utilities.getExecutablePath(args[0]) 318 args[0] = Utilities.getExecutablePath(args[0])
319 process = self.__startProcess(args[0], args[1:], clientEnv) 319 process = self.__startProcess(args[0], args[1:], clientEnv)
320 if process is None: 320 if process is None:
321 E5MessageBox.critical(None, 321 E5MessageBox.critical(None,
322 self.trUtf8("Start Debugger"), 322 self.trUtf8("Start Debugger"),
323 self.trUtf8(\ 323 self.trUtf8(
324 """<p>The debugger backend could not be started.</p>""")) 324 """<p>The debugger backend could not be started.</p>"""))
325 return process, self.__isNetworked 325 return process, self.__isNetworked
326 326
327 process = self.__startProcess(interpreter, 327 process = self.__startProcess(interpreter,
328 [debugClient, noencoding, str(port), redirect, ipaddr], 328 [debugClient, noencoding, str(port), redirect, ipaddr],
715 def __askForkTo(self): 715 def __askForkTo(self):
716 """ 716 """
717 Private method to ask the user which branch of a fork to follow. 717 Private method to ask the user which branch of a fork to follow.
718 """ 718 """
719 selections = [self.trUtf8("Parent Process"), self.trUtf8("Child process")] 719 selections = [self.trUtf8("Parent Process"), self.trUtf8("Child process")]
720 res, ok = QInputDialog.getItem(\ 720 res, ok = QInputDialog.getItem(
721 None, 721 None,
722 self.trUtf8("Client forking"), 722 self.trUtf8("Client forking"),
723 self.trUtf8("Select the fork branch to follow."), 723 self.trUtf8("Select the fork branch to follow."),
724 selections, 724 selections,
725 0, False) 725 0, False)

eric ide

mercurial