--- a/Debugger/DebuggerInterfacePython.py Sun Jun 17 13:09:00 2018 +0200 +++ b/Debugger/DebuggerInterfacePython.py Sun Jun 17 16:56:10 2018 +0200 @@ -132,20 +132,22 @@ return proc - def startRemote(self, port, runInConsole, interpreter): + def startRemote(self, port, runInConsole, venvName): """ Public method to start a remote Python interpreter. - @param port port number the debug server is listening on (integer) + @param port port number the debug server is listening on + @type int @param runInConsole flag indicating to start the debugger in a - console window (boolean) - @param interpreter interpreter to be used to execute the remote - side (string) - @return client process object (QProcess), a flag to indicate - a network connection (boolean) and the name of the interpreter - in case of a local execution (string) + console window + @type bool + @param venvName name of the virtual environment to be used + @type str + @return client process object, a flag to indicate a network connection + and the name of the interpreter in case of a local execution + @rtype tuple of (QProcess, bool, str) """ - if not interpreter: + if not venvName: if self.__variant == "Python2": venvName = Preferences.getDebugger("Python2VirtualEnv") else: @@ -268,32 +270,37 @@ """<p>The debugger backend could not be started.</p>""")) return process, self.__isNetworked, interpreter - def startRemoteForProject(self, port, runInConsole, interpreter): + def startRemoteForProject(self, port, runInConsole, venvName): """ Public method to start a remote Python interpreter for a project. - @param port port number the debug server is listening on (integer) + @param port port number the debug server is listening on + @type int @param runInConsole flag indicating to start the debugger in a - console window (boolean) - @param interpreter interpreter to be used to execute the remote - side (string) - @return client process object (QProcess), a flag to indicate - a network connection (boolean) and the name of the interpreter - in case of a local execution (string) + console window + @type bool + @param venvName name of the virtual environment to be used + @type str + @return client process object, a flag to indicate a network connection + and the name of the interpreter in case of a local execution + @rtype tuple of (QProcess, bool, str) """ project = e5App().getObject("Project") if not project.isDebugPropertiesLoaded(): return None, self.__isNetworked, "" # start debugger with project specific settings - if not interpreter: - interpreter = project.getDebugProperty("INTERPRETER") + if not venvName: + venvName = project.getDebugProperty("VIRTUALENV") debugClient = project.getDebugProperty("DEBUGCLIENT") redirect = str(project.getDebugProperty("REDIRECT")) noencoding = \ project.getDebugProperty("NOENCODING") and '--no-encoding' or '' + interpreter = e5App().getObject("VirtualEnvManager")\ + .getVirtualenvInterpreter(venvName) + if project.getDebugProperty("REMOTEDEBUGGER"): ipaddr = self.debugServer.getHostAddress(False) rexec = project.getDebugProperty("REMOTECOMMAND")