@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Create Interactive Console", 10);
IStatus returnStatus = Status.OK_STATUS;
try {
ScriptConsoleManager manager = ScriptConsoleManager.getInstance();
PydevConsole console;
if (interpreter.getFrame() == null) {
monitor.worked(1);
console = new PydevConsole(interpreter, additionalInitialComands);
monitor.worked(1);
try {
createDebugTarget(interpreter, console, new SubProgressMonitor(monitor, 8));
} catch (UserCanceledException uce) {
return Status.CANCEL_STATUS;
} catch (Exception e) {
//Just set the return status, but keep on going to add the console to the manager (as the message says).
returnStatus = PydevDebugPlugin
.makeStatus(
IStatus.ERROR,
"Unable to connect debugger to Interactive Console\n"
+ "The interactive console will continue to operate without the additional debugger features",
e);
}
manager.add(console, true);
}
} catch (Exception e) {
Log.log(e);
returnStatus = PydevDebugPlugin.makeStatus(IStatus.ERROR, "Error initializing console.", e);