fixed PY-13282 Create New project: Install required packages to the interpreter w/o pip

This commit is contained in:
Ekaterina Tuzova
2014-06-23 14:59:28 +04:00
parent 2e5a6a0def
commit f7faeec250
2 changed files with 24 additions and 2 deletions
@@ -272,14 +272,21 @@ abstract public class AbstractProjectSettingsStep extends AbstractActionWithPane
final PyPackageManagerImpl packageManager = (PyPackageManagerImpl)PyPackageManager.getInstance(sdk);
final boolean onlyWithCache =
PythonSdkFlavor.getFlavor(sdk) instanceof JythonSdkFlavor || PythonSdkFlavor.getFlavor(sdk) instanceof PyPySdkFlavor;
String warningText = frameworkName + " will be installed on selected interpreter";
try {
if (onlyWithCache && packageManager.cacheIsNotNull() || !onlyWithCache) {
final PyPackage pip = packageManager.findInstalledPackage("pip");
myInstallFramework = pip != null;
setWarningText(frameworkName + " will be installed on selected interpreter");
myInstallFramework = true;
if (pip == null) {
warningText = "pip and " + warningText;
}
setWarningText(warningText);
}
}
catch (PyExternalProcessException ignored) {
myInstallFramework = true;
warningText = "pip and " + warningText;
setWarningText(warningText);
}
if (!myInstallFramework) {
setErrorText("No " + frameworkName + " support installed in selected interpreter");