eric6/Debugger/DebuggerInterfacePython.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8142
43248bafe9b2
parent 8163
29fb6d420a25
child 8273
698ae46f40a4
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
151 proc = None 151 proc = None
152 152
153 return proc 153 return proc
154 154
155 def startRemote(self, port, runInConsole, venvName, originalPathString, 155 def startRemote(self, port, runInConsole, venvName, originalPathString,
156 workingDir=None): 156 workingDir=None, configOverride=None):
157 """ 157 """
158 Public method to start a remote Python interpreter. 158 Public method to start a remote Python interpreter.
159 159
160 @param port port number the debug server is listening on 160 @param port port number the debug server is listening on
161 @type int 161 @type int
166 @type str 166 @type str
167 @param originalPathString original PATH environment variable 167 @param originalPathString original PATH environment variable
168 @type str 168 @type str
169 @param workingDir directory to start the debugger client in 169 @param workingDir directory to start the debugger client in
170 @type str 170 @type str
171 @param configOverride dictionary containing the global config override
172 data
173 @type dict
171 @return client process object, a flag to indicate a network connection 174 @return client process object, a flag to indicate a network connection
172 and the name of the interpreter in case of a local execution 175 and the name of the interpreter in case of a local execution
173 @rtype tuple of (QProcess, bool, str) 176 @rtype tuple of (QProcess, bool, str)
174 """ 177 """
175 global origPathEnv 178 global origPathEnv
203 if debugClient == "": 206 if debugClient == "":
204 debugClient = os.path.join(sys.path[0], 207 debugClient = os.path.join(sys.path[0],
205 "DebugClients", "Python", 208 "DebugClients", "Python",
206 "DebugClient.py") 209 "DebugClient.py")
207 210
208 redirect = str(Preferences.getDebugger("Python3Redirect")) 211 if configOverride and configOverride["enable"]:
212 redirect = str(configOverride["redirect"])
213 else:
214 redirect = str(Preferences.getDebugger("Python3Redirect"))
209 noencoding = (Preferences.getDebugger("Python3NoEncoding") and 215 noencoding = (Preferences.getDebugger("Python3NoEncoding") and
210 '--no-encoding' or '') 216 '--no-encoding' or '')
211 multiprocessEnabled = ( 217 multiprocessEnabled = (
212 '--multiprocess' if Preferences.getDebugger("MultiProcessEnabled") 218 '--multiprocess' if Preferences.getDebugger("MultiProcessEnabled")
213 else '' 219 else ''
326 self.__startedVenv = venvName 332 self.__startedVenv = venvName
327 333
328 return process, self.__isNetworked, interpreter 334 return process, self.__isNetworked, interpreter
329 335
330 def startRemoteForProject(self, port, runInConsole, venvName, 336 def startRemoteForProject(self, port, runInConsole, venvName,
331 originalPathString, workingDir=None): 337 originalPathString, workingDir=None,
338 configOverride=None):
332 """ 339 """
333 Public method to start a remote Python interpreter for a project. 340 Public method to start a remote Python interpreter for a project.
334 341
335 @param port port number the debug server is listening on 342 @param port port number the debug server is listening on
336 @type int 343 @type int
341 @type str 348 @type str
342 @param originalPathString original PATH environment variable 349 @param originalPathString original PATH environment variable
343 @type str 350 @type str
344 @param workingDir directory to start the debugger client in 351 @param workingDir directory to start the debugger client in
345 @type str 352 @type str
353 @param configOverride dictionary containing the global config override
354 data
355 @type dict
346 @return client process object, a flag to indicate a network connection 356 @return client process object, a flag to indicate a network connection
347 and the name of the interpreter in case of a local execution 357 and the name of the interpreter in case of a local execution
348 @rtype tuple of (QProcess, bool, str) 358 @rtype tuple of (QProcess, bool, str)
349 """ 359 """
350 global origPathEnv 360 global origPathEnv
359 venvName = project.getDebugProperty("VIRTUALENV") 369 venvName = project.getDebugProperty("VIRTUALENV")
360 if not venvName: 370 if not venvName:
361 if project.getProjectLanguage() == "Python3": 371 if project.getProjectLanguage() == "Python3":
362 venvName = Preferences.getDebugger("Python3VirtualEnv") 372 venvName = Preferences.getDebugger("Python3VirtualEnv")
363 373
364 redirect = str(project.getDebugProperty("REDIRECT")) 374 if configOverride and configOverride["enable"]:
375 redirect = str(configOverride["redirect"])
376 else:
377 redirect = str(project.getDebugProperty("REDIRECT"))
365 noencoding = ( 378 noencoding = (
366 '--no-encoding' if project.getDebugProperty("NOENCODING") else '' 379 '--no-encoding' if project.getDebugProperty("NOENCODING") else ''
367 ) 380 )
368 multiprocessEnabled = ( 381 multiprocessEnabled = (
369 '--multiprocess' if Preferences.getDebugger("MultiProcessEnabled") 382 '--multiprocess' if Preferences.getDebugger("MultiProcessEnabled")

eric ide

mercurial