Examples of IInterpreterManager


Examples of org.python.pydev.core.IInterpreterManager

        String[] parameters = SimpleIronpythonRunner.preparePythonCallParameters(interpreter.getExecutableOrJar(),
                FileUtils.getFileAbsolutePath(serverFile), new String[] { String.valueOf(pWrite), String.valueOf(pRead) },
                true);

        IInterpreterManager manager = PydevPlugin.getIronpythonInterpreterManager();

        String[] envp = null;
        try {
            envp = SimpleRunner.getEnvironment(null, interpreter, manager);
        } catch (CoreException e) {
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

    protected Tuple<String, IInterpreterManager> getLaunchConfigurationTypeAndInterpreterManager(PyEdit pyEdit,
            boolean isUnitTest) {
        String launchConfigurationType;
        String defaultType = Constants.ID_PYTHON_REGULAR_LAUNCH_CONFIGURATION_TYPE;
        IInterpreterManager interpreterManager = PydevPlugin.getPythonInterpreterManager();

        try {
            IPythonNature nature = pyEdit.getPythonNature();
            if (nature == null) {
                launchConfigurationType = defaultType;
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

     * @throws MisconfigurationException
     */
    public static String[] makeExecutableCommandStrWithVMArgs(String jythonJar, String script, String basePythonPath,
            String vmArgs, String... args) throws IOException, JDTNotAvailableException, MisconfigurationException {

        IInterpreterManager interpreterManager = PydevPlugin.getJythonInterpreterManager();
        String javaLoc = JavaVmLocationFinder.findDefaultJavaExecutable().getCanonicalPath();

        File file = new File(javaLoc);
        if (file.exists() == false) {
            throw new RuntimeException("The java location found does not exist. " + javaLoc);
        }
        if (file.isDirectory() == true) {
            throw new RuntimeException("The java location found is a directory. " + javaLoc);
        }

        if (!new File(jythonJar).exists()) {
            throw new RuntimeException(com.aptana.shared_core.string.StringUtils.format(
                    "Error. The default configured interpreter: %s does not exist!", jythonJar));
        }
        InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(jythonJar,
                new NullProgressMonitor());

        //pythonpath is: base path + libs path.
        String libs = SimpleRunner.makePythonPathEnvFromPaths(info.libs);
        FastStringBuffer jythonPath = new FastStringBuffer(basePythonPath, 128);
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        }

        try {
            String projectInterpreterName = getProjectInterpreterName();
            IInterpreterInfo ret;
            IInterpreterManager relatedInterpreterManager = getRelatedInterpreterManager();
            if (relatedInterpreterManager == null) {
                if (IN_TESTS) {
                    return null;
                }
                throw new ProjectMisconfiguredException("Did not expect the interpreter manager to be null.");
            }

            if (IPythonNature.DEFAULT_INTERPRETER.equals(projectInterpreterName)) {
                //if it's the default, let's translate it to the outside world
                ret = relatedInterpreterManager.getDefaultInterpreterInfo(true);
            } else {
                ret = relatedInterpreterManager.getInterpreterInfo(projectInterpreterName, null);
            }
            if (ret == null) {
                final IProject p = this.getProject();
                final String projectName;
                if (p != null) {
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        this.nature = nature;
    }

    public IPythonNature getNature() {
        if (nature == null) {
            IInterpreterManager manager = getInterpreterManager();
            nature = new SystemPythonNature(manager, this.info);
        }
        return nature;
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

     * May return null if unable to choose an interpreter.
     *
     * TODO: Instead of choosing always python as default if both are available, ask the user (and save that info).
     */
    public static IInterpreterManager chooseInterpreterManager() {
        IInterpreterManager manager = PydevPlugin.getPythonInterpreterManager();
        if (manager.isConfigured()) {
            return manager;
        }

        manager = PydevPlugin.getJythonInterpreterManager();
        if (manager.isConfigured()) {
            return manager;
        }

        manager = PydevPlugin.getIronpythonInterpreterManager();
        if (manager.isConfigured()) {
            return manager;
        }

        return null;
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        super.performOk();

        //we need to update the tree so that the environment variables stay correct.
        pathEditor.updateTree();

        IInterpreterManager interpreterManager = getInterpreterManager();
        String newStringToPersist = AbstractInterpreterManager.getStringToPersist(pathEditor.getExesList());
        String oldStringToPersist = AbstractInterpreterManager.getStringToPersist(interpreterManager
                .getInterpreterInfos());
        boolean changed;
        if (!newStringToPersist.equals(oldStringToPersist)) {
            changed = true;
        } else {
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        defaultVersion = DJANGO_14; //It should be discovered below, but if not found for some reason, this will be the default.

        SystemPythonNature nature;
        try {
            final int interpreterType = PythonNature.getInterpreterTypeFromVersion(projectType);
            IInterpreterManager interpreterManagerFromType = PydevPlugin.getInterpreterManagerFromType(interpreterType);
            IInterpreterInfo interpreterInfo;
            if (IPythonNature.DEFAULT_INTERPRETER.equals(projectInterpreter)) {
                interpreterInfo = interpreterManagerFromType.getDefaultInterpreterInfo(false);

            } else {
                interpreterInfo = interpreterManagerFromType.getInterpreterInfo(projectInterpreter, null);

            }
            nature = new SystemPythonNature(interpreterManagerFromType, interpreterInfo);
            AbstractRunner runner = UniversalRunner.getRunner(nature);
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

    @Override
    public IWizardPage getNextPage() {
        String projectType = this.getProjectType();

        IInterpreterManager interpreterManager;
        if (IPythonNature.Versions.ALL_JYTHON_VERSIONS.contains(projectType)) {
            interpreterManager = PydevPlugin.getJythonInterpreterManager();

        } else if (IPythonNature.Versions.ALL_IRONPYTHON_VERSIONS.contains(projectType)) {
            interpreterManager = PydevPlugin.getIronpythonInterpreterManager();

        } else {
            //if others fail, consider it python
            interpreterManager = PydevPlugin.getPythonInterpreterManager();
        }

        try {
            String projectInterpreter = this.getProjectInterpreter();
            IInterpreterInfo interpreterInfo;
            if (projectInterpreter.toLowerCase().equals("default")) {
                interpreterInfo = interpreterManager.getDefaultInterpreterInfo(false);
            } else {
                interpreterInfo = interpreterManager.getInterpreterInfo(projectInterpreter, new NullProgressMonitor());
            }
            IModule module = interpreterInfo.getModulesManager().getModuleWithoutBuiltins("django.core.__init__", null,
                    false);
            if (module == null) {
                DjangoNotAvailableWizardPage page = new DjangoNotAvailableWizardPage("Django not available",
View Full Code Here

Examples of org.python.pydev.core.IInterpreterManager

        boolean restored = super.restoreSystemPythonPath(force, path);
        if (restored) {
            IProgressMonitor monitor = new NullProgressMonitor();

            //try to load it from previous session
            IInterpreterManager interpreterManager = getInterpreterManager();
            try {
                String defaultInterpreter = interpreterManager.getDefaultInterpreterInfo(false).getExecutableOrJar();
                boolean recreate = forceAdditionalInfoRecreation;
                if (!recreate) {
                    //one last check: if TestCase is not found, recreate it!
                    AbstractAdditionalDependencyInfo additionalSystemInfo = AdditionalSystemInterpreterInfo
                            .getAdditionalSystemInfo(interpreterManager, defaultInterpreter);
                    Collection<IInfo> tokensStartingWith = additionalSystemInfo.getTokensStartingWith("TestCase",
                            AbstractAdditionalTokensInfo.TOP_LEVEL);
                    recreate = true;
                    for (IInfo info : tokensStartingWith) {
                        if (info.getName().equals("TestCase")) {
                            if (info.getDeclaringModuleName().equals("unittest")) {
                                recreate = false;
                                break;
                            }
                        }
                    }
                }

                if (recreate) {
                    System.out.println("Recreating: " + this.getClass() + " - "
                            + interpreterManager.getInterpreterInfo(defaultInterpreter, null));
                    observer.notifyDefaultPythonpathRestored(interpreterManager, defaultInterpreter, monitor);
                }
            } catch (MisconfigurationException e) {
                throw new RuntimeException(e);
            }
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.