use of com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase in project intellij-community by JetBrains.
the class PyRemotePackageManagerImpl method getHelperPath.
@Nullable
@Override
protected String getHelperPath(String helper) throws ExecutionException {
final Sdk sdk = getSdk();
final SdkAdditionalData sdkData = sdk.getSdkAdditionalData();
if (sdkData instanceof PyRemoteSdkAdditionalDataBase) {
final PyRemoteSdkAdditionalDataBase remoteSdkData = (PyRemoteSdkAdditionalDataBase) sdkData;
try {
String helpersPath;
if (CaseCollector.useRemoteCredentials(remoteSdkData)) {
final RemoteSdkCredentials remoteSdkCredentials = remoteSdkData.getRemoteSdkCredentials(false);
helpersPath = remoteSdkCredentials.getHelpersPath();
} else {
helpersPath = remoteSdkData.getHelpersPath();
}
if (!StringUtil.isEmpty(helpersPath)) {
return new RemoteFile(helpersPath, helper).getPath();
} else {
return null;
}
} catch (InterruptedException e) {
LOG.error(e);
} catch (ExecutionException e) {
throw analyzeException(e, helper, Collections.<String>emptyList());
}
}
return null;
}
use of com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase in project intellij-community by JetBrains.
the class PyRemoteProcessStarter method doStartRemoteProcess.
protected PyRemoteProcessHandlerBase doStartRemoteProcess(@NotNull Sdk sdk, @NotNull final GeneralCommandLine commandLine, @NotNull final PythonRemoteInterpreterManager manager, @Nullable final Project project, @Nullable PyRemotePathMapper pathMapper) throws ExecutionException {
SdkAdditionalData data = sdk.getSdkAdditionalData();
assert data instanceof PyRemoteSdkAdditionalDataBase;
final PyRemoteSdkAdditionalDataBase pyRemoteSdkAdditionalDataBase = (PyRemoteSdkAdditionalDataBase) data;
final PyRemotePathMapper extendedPathMapper = manager.setupMappings(project, pyRemoteSdkAdditionalDataBase, pathMapper);
try {
return PyRemoteProcessStarterManagerUtil.getManager(pyRemoteSdkAdditionalDataBase).startRemoteProcess(project, commandLine, manager, pyRemoteSdkAdditionalDataBase, extendedPathMapper);
} catch (InterruptedException e) {
throw new ExecutionException(e);
}
}
use of com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase in project intellij-community by JetBrains.
the class PydevConsoleRunnerImpl method createProcessHandler.
private PyConsoleProcessHandler createProcessHandler(final Process process) {
if (PySdkUtil.isRemote(mySdk)) {
PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
if (manager != null) {
PyRemoteSdkAdditionalDataBase data = (PyRemoteSdkAdditionalDataBase) mySdk.getSdkAdditionalData();
assert data != null;
myProcessHandler = manager.createConsoleProcessHandler((RemoteProcess) process, myConsoleView, myPydevConsoleCommunication, myCommandLine, CharsetToolkit.UTF8_CHARSET, manager.setupMappings(myProject, data, null), myRemoteProcessHandlerBase.getRemoteSocketToLocalHostProvider());
} else {
LOG.error("Can't create remote console process handler");
}
} else {
myProcessHandler = new PyConsoleProcessHandler(process, myConsoleView, myPydevConsoleCommunication, myCommandLine, CharsetToolkit.UTF8_CHARSET);
}
return myProcessHandler;
}
Aggregations