Examples of IInterpreterManager


Examples of org.python.pydev.core.IInterpreterManager

    /**
     * Creates the python interpreter manager with the default jython jar location.
     */
    protected static void createPythonInterpreterManager(NullProgressMonitor monitor) {
        IInterpreterManager iMan = PydevPlugin.getPythonInterpreterManager(true);
        IInterpreterInfo interpreterInfo = iMan.createInterpreterInfo(TestDependent.PYTHON_EXE, monitor, false);
        iMan.setInfos(new IInterpreterInfo[] { interpreterInfo }, null, null);
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        IValueVariable myCustomVariable = variableManager.newValueVariable("pydev_python_runner_config_test_var", "",
                true, "my_custom_value");
        variableManager.addVariables(new IValueVariable[] { myCustomVariable });

        try {
            IInterpreterManager manager = PydevPlugin.getPythonInterpreterManager(true);
            InterpreterInfo info = (InterpreterInfo) manager.getDefaultInterpreterInfo(false);
            info.setEnvVariables(new String[] { "MY_CUSTOM_VAR_FOR_TEST=FOO", "MY_CUSTOM_VAR_FOR_TEST2=FOO2",
                    "MY_CUSTOM_VAR_WITH_VAR=${pydev_python_runner_config_test_var}" });

            // Make sure variable hasn't been expanded too early
            assertTrue(arrayContains(info.getEnvVariables(),
                    "MY_CUSTOM_VAR_WITH_VAR=${pydev_python_runner_config_test_var}"));

            PythonRunnerConfig runnerConfig = createConfig();
            assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_FOR_TEST=FOO"));
            assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_FOR_TEST2=FOO2"));
            assertTrue(arrayContains(runnerConfig.envp, "MY_CUSTOM_VAR_WITH_VAR=my_custom_value"));

            String[] argv = runnerConfig.getCommandLine(false);
            assertFalse(arrayContains(argv, PythonRunnerConfig.getRunFilesScript()));
            assertTrue(arrayContains(argv, mod1.getLocation().toOSString()));

            nature.setVersion(IPythonNature.PYTHON_VERSION_LATEST, IPythonNature.DEFAULT_INTERPRETER);
            assertEquals(manager.getDefaultInterpreterInfo(false).getExecutableOrJar(), nature.getProjectInterpreter()
                    .getExecutableOrJar());
            runnerConfig = createConfig();
            argv = runnerConfig.getCommandLine(false);
            assertEquals(manager.getDefaultInterpreterInfo(false).getExecutableOrJar(), argv[0]);

            IInterpreterManager interpreterManager = nature.getRelatedInterpreterManager();

            InterpreterInfo info2 = new InterpreterInfo(IPythonNature.PYTHON_VERSION_2_6, "c:\\interpreter\\py25.exe",
                    new ArrayList<String>());
            interpreterManager.setInfos(new IInterpreterInfo[] { info, info2 }, null, null);

            nature.setVersion(IPythonNature.PYTHON_VERSION_LATEST, "c:\\interpreter\\py25.exe");
            assertEquals("c:\\interpreter\\py25.exe", nature.getProjectInterpreter().getExecutableOrJar());
            runnerConfig = createConfig();
            argv = runnerConfig.getCommandLine(false);
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

     * checks if the size of the system modules manager and the project moule manager are coherent
     * (we must have more modules in the system than in the project)
     */
    protected void checkSize() {
        try {
            IInterpreterManager iMan = getInterpreterManager();
            InterpreterInfo info = (InterpreterInfo) iMan.getDefaultInterpreterInfo(false);
            assertTrue(info.getModulesManager().getSize(true) > 0);

            int size = ((ASTManager) natureRefactoring.getAstManager()).getSize();
            assertTrue("Interpreter size:" + info.getModulesManager().getSize(true)
                    + " should be smaller than project size:" + size + " "
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        setSelectedFrame(null);
        if (checkboxForCurrentEditor.isEnabled() && checkboxForCurrentEditor.getSelection()) {
            IProject project = this.activeEditor.getProject();
            PythonNature nature = PythonNature.getPythonNature(project);
            natures.add(nature);
            IInterpreterManager relatedInterpreterManager = nature.getRelatedInterpreterManager();
            this.interpreterManager = relatedInterpreterManager;

        } else if (checkboxPython.isEnabled() && checkboxPython.getSelection()) {
            this.interpreterManager = PydevPlugin.getPythonInterpreterManager();
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

            if (dialog.getSelectedFrame() != null) {
                // Interpreter not required for Debug Console
                return new PydevConsoleLaunchInfo(null, null, 0, null, dialog.getSelectedFrame());
            }

            IInterpreterManager interpreterManager = dialog.getInterpreterManager();
            if (interpreterManager == null) {
                MessageDialog.openError(workbenchWindow.getShell(), "No interpreter manager for creating console",
                        "No interpreter manager was available for creating a console.");
            }
            IInterpreterInfo[] interpreters = interpreterManager.getInterpreterInfos();
            if (interpreters == null || interpreters.length == 0) {
                MessageDialog.openError(workbenchWindow.getShell(), "No interpreters for creating console",
                        "No interpreter available for creating a console.");
                return null;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.