mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
suggest interpreter home paths for IronPython
This commit is contained in:
@@ -3,8 +3,10 @@ package com.jetbrains.python.sdk;
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -15,6 +17,27 @@ public class IronPythonSdkFlavor extends PythonSdkFlavor {
|
||||
|
||||
public static IronPythonSdkFlavor INSTANCE = new IronPythonSdkFlavor();
|
||||
|
||||
@Override
|
||||
public List<String> suggestHomePaths() {
|
||||
List<String> result = new ArrayList<String>();
|
||||
String root = System.getenv("ProgramFiles(x86)");
|
||||
if (root == null) {
|
||||
root = System.getenv("ProgramFiles");
|
||||
}
|
||||
if (root != null) {
|
||||
final File[] dirs = new File(root).listFiles();
|
||||
for (File dir : dirs) {
|
||||
if (dir.getName().startsWith("IronPython")) {
|
||||
File ipy = new File(dir, "ipy.exe");
|
||||
if (ipy.exists()) {
|
||||
result.add(ipy.getPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidSdkHome(String path) {
|
||||
final String name = new File(path).getName();
|
||||
|
||||
Reference in New Issue
Block a user