Debugger/DebuggerInterfacePython.py

changeset 564
b3d966393ba9
parent 537
72b32daeb8d6
child 711
8cd4f7a574a2
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
145 """ 145 """
146 interpreter = Preferences.getDebugger("PythonInterpreter") 146 interpreter = Preferences.getDebugger("PythonInterpreter")
147 if interpreter == "": 147 if interpreter == "":
148 E5MessageBox.critical(None, 148 E5MessageBox.critical(None,
149 self.trUtf8("Start Debugger"), 149 self.trUtf8("Start Debugger"),
150 self.trUtf8(\ 150 self.trUtf8(
151 """<p>No Python2 interpreter configured.</p>""")) 151 """<p>No Python2 interpreter configured.</p>"""))
152 return None, False 152 return None, False
153 153
154 debugClientType = Preferences.getDebugger("DebugClientType") 154 debugClientType = Preferences.getDebugger("DebugClientType")
155 if debugClientType == "standard": 155 if debugClientType == "standard":
181 args[0] = Utilities.getExecutablePath(args[0]) 181 args[0] = Utilities.getExecutablePath(args[0])
182 process = self.__startProcess(args[0], args[1:]) 182 process = self.__startProcess(args[0], args[1:])
183 if process is None: 183 if process is None:
184 E5MessageBox.critical(None, 184 E5MessageBox.critical(None,
185 self.trUtf8("Start Debugger"), 185 self.trUtf8("Start Debugger"),
186 self.trUtf8(\ 186 self.trUtf8(
187 """<p>The debugger backend could not be started.</p>""")) 187 """<p>The debugger backend could not be started.</p>"""))
188 188
189 # set translation function 189 # set translation function
190 if Preferences.getDebugger("PathTranslation"): 190 if Preferences.getDebugger("PathTranslation"):
191 self.translateRemote = \ 191 self.translateRemote = \
203 # setup the environment for the debugger 203 # setup the environment for the debugger
204 if Preferences.getDebugger("DebugEnvironmentReplace"): 204 if Preferences.getDebugger("DebugEnvironmentReplace"):
205 clientEnv = {} 205 clientEnv = {}
206 else: 206 else:
207 clientEnv = os.environ.copy() 207 clientEnv = os.environ.copy()
208 envlist = Utilities.parseEnvironmentString(\ 208 envlist = Utilities.parseEnvironmentString(
209 Preferences.getDebugger("DebugEnvironment")) 209 Preferences.getDebugger("DebugEnvironment"))
210 for el in envlist: 210 for el in envlist:
211 try: 211 try:
212 key, value = el.split('=', 1) 212 key, value = el.split('=', 1)
213 if value.startswith('"') or value.startswith("'"): 213 if value.startswith('"') or value.startswith("'"):
226 args[0] = Utilities.getExecutablePath(args[0]) 226 args[0] = Utilities.getExecutablePath(args[0])
227 process = self.__startProcess(args[0], args[1:], clientEnv) 227 process = self.__startProcess(args[0], args[1:], clientEnv)
228 if process is None: 228 if process is None:
229 E5MessageBox.critical(None, 229 E5MessageBox.critical(None,
230 self.trUtf8("Start Debugger"), 230 self.trUtf8("Start Debugger"),
231 self.trUtf8(\ 231 self.trUtf8(
232 """<p>The debugger backend could not be started.</p>""")) 232 """<p>The debugger backend could not be started.</p>"""))
233 return process, self.__isNetworked 233 return process, self.__isNetworked
234 234
235 process = self.__startProcess(interpreter, 235 process = self.__startProcess(interpreter,
236 [debugClient, noencoding, str(port), redirect, ipaddr], 236 [debugClient, noencoding, str(port), redirect, ipaddr],
276 args[0] = Utilities.getExecutablePath(args[0]) 276 args[0] = Utilities.getExecutablePath(args[0])
277 process = self.__startProcess(args[0], args[1:]) 277 process = self.__startProcess(args[0], args[1:])
278 if process is None: 278 if process is None:
279 E5MessageBox.critical(None, 279 E5MessageBox.critical(None,
280 self.trUtf8("Start Debugger"), 280 self.trUtf8("Start Debugger"),
281 self.trUtf8(\ 281 self.trUtf8(
282 """<p>The debugger backend could not be started.</p>""")) 282 """<p>The debugger backend could not be started.</p>"""))
283 # set translation function 283 # set translation function
284 if project.getDebugProperty("PATHTRANSLATION"): 284 if project.getDebugProperty("PATHTRANSLATION"):
285 self.translateRemote = project.getDebugProperty("REMOTEPATH") 285 self.translateRemote = project.getDebugProperty("REMOTEPATH")
286 self.translateLocal = project.getDebugProperty("LOCALPATH") 286 self.translateLocal = project.getDebugProperty("LOCALPATH")
319 args[0] = Utilities.getExecutablePath(args[0]) 319 args[0] = Utilities.getExecutablePath(args[0])
320 process = self.__startProcess(args[0], args[1:], clientEnv) 320 process = self.__startProcess(args[0], args[1:], clientEnv)
321 if process is None: 321 if process is None:
322 E5MessageBox.critical(None, 322 E5MessageBox.critical(None,
323 self.trUtf8("Start Debugger"), 323 self.trUtf8("Start Debugger"),
324 self.trUtf8(\ 324 self.trUtf8(
325 """<p>The debugger backend could not be started.</p>""")) 325 """<p>The debugger backend could not be started.</p>"""))
326 return process, self.__isNetworked 326 return process, self.__isNetworked
327 327
328 process = self.__startProcess(interpreter, 328 process = self.__startProcess(interpreter,
329 [debugClient, noencoding, str(port), redirect, ipaddr], 329 [debugClient, noencoding, str(port), redirect, ipaddr],
716 def __askForkTo(self): 716 def __askForkTo(self):
717 """ 717 """
718 Private method to ask the user which branch of a fork to follow. 718 Private method to ask the user which branch of a fork to follow.
719 """ 719 """
720 selections = [self.trUtf8("Parent Process"), self.trUtf8("Child process")] 720 selections = [self.trUtf8("Parent Process"), self.trUtf8("Child process")]
721 res, ok = QInputDialog.getItem(\ 721 res, ok = QInputDialog.getItem(
722 None, 722 None,
723 self.trUtf8("Client forking"), 723 self.trUtf8("Client forking"),
724 self.trUtf8("Select the fork branch to follow."), 724 self.trUtf8("Select the fork branch to follow."),
725 selections, 725 selections,
726 0, False) 726 0, False)

eric ide

mercurial