use of com.jetbrains.python.run.PythonRunConfiguration in project intellij-community by JetBrains.
the class PyEduDebugRunner method getScriptName.
@Nullable
private static String getScriptName(PythonCommandLineState pyState) {
ExecutionEnvironment environment = pyState.getEnvironment();
if (environment == null) {
return null;
}
RunProfile runProfile = environment.getRunProfile();
if (runProfile instanceof PythonRunConfiguration) {
String name = FileUtil.toSystemIndependentName(((PythonRunConfiguration) runProfile).getScriptName());
return SystemInfo.isWindows ? name.toLowerCase() : name;
}
return null;
}
use of com.jetbrains.python.run.PythonRunConfiguration in project intellij-community by JetBrains.
the class PyAttachToProcessCommandLineState method create.
public static PyAttachToProcessCommandLineState create(@NotNull Project project, @NotNull String sdkPath, int port, int pid) throws ExecutionException {
PythonRunConfiguration conf = (PythonRunConfiguration) PythonConfigurationType.getInstance().getFactory().createTemplateConfiguration(project);
conf.setScriptName(PythonHelper.ATTACH_DEBUGGER.asParamString());
conf.setSdkHome(sdkPath);
conf.setScriptParameters("--port " + port + " --pid " + pid);
ExecutionEnvironment env = ExecutionEnvironmentBuilder.create(project, DefaultDebugExecutor.getDebugExecutorInstance(), conf).build();
return new PyAttachToProcessCommandLineState(conf, env);
}
Aggregations