use of org.python.pydev.ui.pythonpathconf.AutoConfigMaker 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;
}
Aggregations