PY-13328 Create New Project: warning about installing template packages is not shown

This commit is contained in:
Ekaterina Tuzova
2016-05-26 17:36:55 +03:00
parent f41e46174a
commit 4e66e64a90
3 changed files with 23 additions and 14 deletions
@@ -19,6 +19,7 @@ import com.intellij.execution.ExecutionException;
import com.intellij.facet.ui.ValidationResult;
import com.intellij.lang.Language;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiElement;
import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
@@ -38,7 +39,10 @@ public class PyTemplatesUtil {
String templateBinding = null;
@NonNls String language = templatesPanel.getTemplateLanguage();
if (language != null) {
String framework = StringUtil.trimEnd(prefix, '_');
framework = StringUtil.trimEnd(framework, '-');
String postfix = language.toLowerCase();
if (framework.equals(postfix)) return ValidationResult.OK;
if (language.equals(TemplatesService.JINJA2)) {
postfix = "jinja";
}
@@ -50,7 +54,7 @@ public class PyTemplatesUtil {
try {
final PyPackage installedPackage = packageManager.findPackage(templateBinding, false);
if (installedPackage == null) {
return new ValidationResult(templateBinding + " will be installed on selected interpreter");
return new ValidationResult(templateBinding + " will be installed on the selected interpreter");
}
}
catch (ExecutionException ignored) {
@@ -61,7 +65,7 @@ public class PyTemplatesUtil {
try {
final PyPackage installedPackage = packageManager.findPackage(language, false);
if (installedPackage == null) {
return new ValidationResult(language + " will be installed on selected interpreter");
return new ValidationResult(language + " will be installed on the selected interpreter");
}
}
catch (ExecutionException ignored) {