mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-19877 Default volume binding from project directory to /opt/project docker container path added for Python console
This commit is contained in:
@@ -131,6 +131,7 @@ public class PydevConsoleRunnerImpl implements PydevConsoleRunner {
|
||||
public static final String PYDEV_PYDEVCONSOLE_PY = "pydev/pydevconsole.py";
|
||||
public static final int PORTS_WAITING_TIMEOUT = 20000;
|
||||
private static final String CONSOLE_FEATURE = "python.console";
|
||||
private static final String DOCKER_CONTAINER_PROJECT_PATH = "/opt/project";
|
||||
private final Project myProject;
|
||||
private final String myTitle;
|
||||
private final String myWorkingDir;
|
||||
@@ -446,6 +447,10 @@ public class PydevConsoleRunnerImpl implements PydevConsoleRunner {
|
||||
|
||||
commandLine.putUserData(PyRemoteProcessStarter.OPEN_FOR_INCOMING_CONNECTION, true);
|
||||
|
||||
// we do not have an option to setup Docker container settings now for Python console so we should bind at least project
|
||||
// directory to some path inside the Docker container
|
||||
commandLine.putUserData(PythonRemoteInterpreterManager.ADDITIONAL_MAPPINGS, buildDockerPathMappings());
|
||||
|
||||
myRemoteProcessHandlerBase = PyRemoteProcessStarterManagerUtil
|
||||
.getManager(data).startRemoteProcess(myProject, commandLine, manager, data,
|
||||
pathMapper);
|
||||
@@ -486,6 +491,12 @@ public class PydevConsoleRunnerImpl implements PydevConsoleRunner {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private PathMappingSettings buildDockerPathMappings() {
|
||||
return new PathMappingSettings(Collections.singletonList(new PathMappingSettings.PathMapping(myProject.getBasePath(),
|
||||
DOCKER_CONTAINER_PROJECT_PATH)));
|
||||
}
|
||||
|
||||
private static Couple<Integer> getRemotePortsFromProcess(RemoteProcess process) throws ExecutionException {
|
||||
Scanner s = new Scanner(process.getInputStream());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user