use of org.python.pydev.ast.interpreter_managers.AbstractInterpreterManager in project Pydev by fabioz.
the class ConfigureInterpreterJob method runInUIThread.
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
Set<AbstractInterpreterManager> current = interpreters;
interpreters = new HashSet<AbstractInterpreterManager>();
for (AbstractInterpreterManager m : current) {
try {
m.getDefaultInterpreterInfo(false);
// Maybe it got configured at some other point...
continue;
} catch (NotConfiguredInterpreterException e) {
int ret = PyDialogHelpers.openQuestionConfigureInterpreter(m);
if (ret != PyDialogHelpers.INTERPRETER_CANCEL_CONFIG) {
if (ret == InterpreterConfigHelpers.CONFIG_MANUAL) {
PreferencesUtil.createPreferenceDialogOn(null, m.getPreferencesPageId(), null, null).open();
} else if (ret == InterpreterConfigHelpers.CONFIG_ADV_AUTO || ret == InterpreterConfigHelpers.CONFIG_AUTO) {
InterpreterType interpreterType;
switch(m.getInterpreterType()) {
case IPythonNature.INTERPRETER_TYPE_JYTHON:
interpreterType = InterpreterType.JYTHON;
break;
case IPythonNature.INTERPRETER_TYPE_IRONPYTHON:
interpreterType = InterpreterType.IRONPYTHON;
break;
default:
interpreterType = InterpreterType.PYTHON;
}
boolean advanced = ret == InterpreterConfigHelpers.CONFIG_ADV_AUTO;
AutoConfigMaker a = new AutoConfigMaker(interpreterType, advanced, null, null);
a.autoConfigSingleApply(null);
} else {
Log.log("Unexpected option: " + ret);
}
}
}
}
return Status.OK_STATUS;
}
use of org.python.pydev.ast.interpreter_managers.AbstractInterpreterManager in project Pydev by fabioz.
the class JythonCodeCompletionTestsBase method setInterpreterManager.
@Override
protected void setInterpreterManager(String path) {
AbstractInterpreterManager interpreterManager = new JythonInterpreterManager(this.getPreferences());
InterpreterInfo info;
info = (InterpreterInfo) interpreterManager.createInterpreterInfo(TestDependent.JYTHON_JAR_LOCATION, new NullProgressMonitor(), false);
if (!info.executableOrJar.equals(TestDependent.JYTHON_JAR_LOCATION)) {
throw new RuntimeException("expected same");
}
if (path != null) {
info = new InterpreterInfo(info.getVersion(), TestDependent.JYTHON_JAR_LOCATION, PythonPathHelper.parsePythonPathFromStr(path, new ArrayList<String>()));
}
interpreterManager.setInfos(new IInterpreterInfo[] { info }, null, null);
InterpreterManagersAPI.setJythonInterpreterManager(interpreterManager);
}
Aggregations