Search in sources :

Example 1 with ScriptConsoleManager

use of org.python.pydev.shared_interactive_console.console.ui.ScriptConsoleManager in project Pydev by fabioz.

the class PydevConsoleFactory method createDebugConsole.

/**
 * Create a new Debug Console
 *
 * @param interpreter
 * @param additionalInitialComands
 * @return
 */
private PydevDebugConsole createDebugConsole(ILaunch launch, PyStackFrame frame, String additionalInitialComands, boolean addToManager, boolean bufferedOutput, IPyStackFrameProvider consoleFrameProvider) throws Exception {
    PydevConsoleLaunchInfo launchAndProcess = new PydevConsoleLaunchInfo(null, null, 0, null, frame, null, null, launch != null ? PydevIProcessFactory.getEncodingFromLaunch(launch) : PydevIProcessFactory.getEncodingFromFrame(frame));
    PydevConsoleInterpreter interpreter = createPydevDebugInterpreter(launchAndProcess, bufferedOutput, consoleFrameProvider);
    PydevDebugConsole console = new PydevDebugConsole(interpreter, additionalInitialComands);
    if (addToManager) {
        ScriptConsoleManager manager = ScriptConsoleManager.getInstance();
        manager.add(console, true);
    }
    return console;
}
Also used : PydevConsoleLaunchInfo(org.python.pydev.debug.newconsole.env.PydevIProcessFactory.PydevConsoleLaunchInfo) ScriptConsoleManager(org.python.pydev.shared_interactive_console.console.ui.ScriptConsoleManager)

Example 2 with ScriptConsoleManager

use of org.python.pydev.shared_interactive_console.console.ui.ScriptConsoleManager in project Pydev by fabioz.

the class PydevConsoleFactory method connectDebugger.

private void connectDebugger(final PydevConsoleInterpreter interpreter, final String additionalInitialComands, IProgressMonitor monitor) throws IOException, CoreException, DebugException, UserCanceledException {
    monitor.beginTask("Connect Debugger", 10);
    try {
        if (interpreter.getFrame() == null) {
            monitor.worked(1);
            PydevConsole console = new PydevConsole(interpreter, additionalInitialComands);
            monitor.worked(1);
            createDebugTarget(interpreter, console, new SubProgressMonitor(monitor, 8));
            ScriptConsoleManager manager = ScriptConsoleManager.getInstance();
            manager.add(console, true);
        }
    } finally {
        monitor.done();
    }
}
Also used : ScriptConsoleManager(org.python.pydev.shared_interactive_console.console.ui.ScriptConsoleManager) SubProgressMonitor(org.eclipse.core.runtime.SubProgressMonitor)

Aggregations

ScriptConsoleManager (org.python.pydev.shared_interactive_console.console.ui.ScriptConsoleManager)2 SubProgressMonitor (org.eclipse.core.runtime.SubProgressMonitor)1 PydevConsoleLaunchInfo (org.python.pydev.debug.newconsole.env.PydevIProcessFactory.PydevConsoleLaunchInfo)1