Re: [Pydev-code] Open python console without dialog
Brought to you by:
fabioz
|
From: Fabio Z. <fa...@es...> - 2009-11-05 12:33:01
|
Not right now, but if you want, you can create an
createInteractiveLaunch() with receiving parameters instead of opening
the dialog (whith the current createInteractiveLaunch() calling it)
and submit that as a patch -- and I'll apply it for the next release.
Cheers,
Fabio
On Wed, Nov 4, 2009 at 3:40 PM, vincent lapointe
<lap...@ho...> wrote:
>
>
> Hi,
>
> I'm using the following code (extract from the PydevConsoleFactory) to open programmatically a python console. When the createInteractiveLaunch method is called, the application prompt for the type of dialog I want to open. Is there a way to open the console without showing the dialog and to automatically select the Python Console type?
>
>
> private void function() {
> ScriptConsoleManager manager = ScriptConsoleManager.getInstance();
> try {
> PydevConsoleInterpreter interpreter = createDefaultPydevInterpreter();
> if(interpreter != null){
> PydevConsole console = new PydevConsole(interpreter);
> manager.add(console, true);
> }
> } catch (Exception e) {
> PydevPlugin.log(e);
> }
> }
>
> private PydevConsoleInterpreter createDefaultPydevInterpreter() throws Exception, UserCanceledException {
> IProcessFactory iprocessFactory = new IProcessFactory();
> Tuple3<Launch, Process, Integer> launchAndProcess = iprocessFactory.createInteractiveLaunch();
>
> if(launchAndProcess == null){
> return null;
> }
> final ILaunch launch = launchAndProcess.o1;
> if(launch == null){
> return null;
> }
> PydevConsoleInterpreter consoleInterpreter = new PydevConsoleInterpreter();
> int port = Integer.parseInt(launch.getAttribute(IProcessFactory.INTERACTIVE_LAUNCH_PORT));
> consoleInterpreter.setConsoleCommunication(new PydevConsoleCommunication(port, launchAndProcess.o2, launchAndProcess.o3));
> consoleInterpreter.setNaturesUsed(iprocessFactory.getNaturesUsed());
>
> PydevDebugPlugin.getDefault().addConsoleLaunch(launch);
>
> consoleInterpreter.addCloseOperation(new Runnable() {
> public void run() {
> PydevDebugPlugin.getDefault().removeConsoleLaunch(launch);
> }
> });
> return consoleInterpreter;
> }
>
> Thank
>
> Vincent
>
>
> _________________________________________________________________
> Windows Live: Keep your friends up to date with what you do online.
> http://go.microsoft.com/?linkid=9691815
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> pydev-code mailing list
> pyd...@li...
> https://lists.sourceforge.net/lists/listinfo/pydev-code
>
|