Examples of IInterpreterInfo


Examples of org.python.pydev.core.IInterpreterInfo

            int retCode = d.open();
            if (retCode == InputDialog.OK) {
                String newName = d.getValue().trim();
                if (!newName.equals(initialName)) {
                    IInterpreterInfo info = this.nameToInfo.get(initialName);
                    info.setName(newName);
                    curr.setText(0, newName);
                    this.nameToInfo.remove(initialName);
                    this.nameToInfo.put(newName, info);
                    this.exeOrJarOfInterpretersToRestore.add(info.getExecutableOrJar());
                }
            }
        }
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

            //Work with a copy of the interpreters actually configured.
            String s = interpreterManager.getPersistedString();
            IInterpreterInfo[] array = interpreterManager.getInterpretersFromPersistedString(s);
            clearInfos();
            for (int i = 0; i < array.length; i++) {
                IInterpreterInfo interpreterInfo = array[i];
                createInterpreterItem(interpreterInfo.getName(), interpreterInfo.getExecutableOrJar());
                this.nameToInfo.put(interpreterInfo.getName(), interpreterInfo.makeCopy());
            }
        }
        updateTree();
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

        }

        if (this.viewer instanceof IScriptConsoleViewer) {
            //interactive console
            IScriptConsoleViewer v = (IScriptConsoleViewer) this.viewer;
            IInterpreterInfo interpreterInfo = (IInterpreterInfo) v.getInterpreterInfo();
            if (interpreterInfo != null) {
                return interpreterInfo.getGrammarVersion();
            }

        }
        return IGrammarVersionProvider.LATEST_GRAMMAR_VERSION;
    }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

        }

        Map<String, String> variableSubstitution;
        if (addInterpreterInfoSubstitutions) {

            IInterpreterInfo info = nature.getProjectInterpreter();
            Properties stringSubstitutionVariables = info.getStringSubstitutionVariables();
            if (stringSubstitutionVariables == null) {
                variableSubstitution = new HashMap<String, String>();
            } else {
                variableSubstitution = PropertiesHelper.createMapFromProperties(stringSubstitutionVariables);
            }
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

    public IInterpreterInfo getDefaultInterpreterInfo(boolean autoConfigureIfNotConfigured)
            throws NotConfiguredInterpreterException {
        IInterpreterInfo[] interpreters = getInterpreterInfos();
        String errorMsg = null;
        if (interpreters.length > 0) {
            IInterpreterInfo defaultInfo = interpreters[0];
            String interpreter = defaultInfo.getExecutableOrJar();
            if (interpreter == null) {
                errorMsg = "The configured interpreter for " + getInterpreterUIName()
                        + " is null, some error happened getting it.";
            }
            return defaultInfo;
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

            }
        }
    }

    private void restorePythopathForNatures(IProgressMonitor monitor) {
        IInterpreterInfo defaultInterpreterInfo;
        try {
            defaultInterpreterInfo = getDefaultInterpreterInfo(false);
        } catch (NotConfiguredInterpreterException e1) {
            defaultInterpreterInfo = null; //go on as usual... (the natures must know that they're not bound to an interpreter anymore).
        }

        FastStringBuffer buf = new FastStringBuffer();
        //Also notify that all the natures had the pythonpath changed (it's the system pythonpath, but still,
        //clients need to know about it)
        List<IPythonNature> pythonNatures;
        try {
            pythonNatures = PythonNature.getAllPythonNatures();
        } catch (IllegalStateException e1) {
            //java.lang.IllegalStateException: Workspace is closed.
            //      at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:367)
            return;
        }
        for (IPythonNature nature : pythonNatures) {
            try {
                //If they have the same type of the interpreter manager, notify.
                if (this.getInterpreterType() == nature.getInterpreterType()) {
                    IPythonPathNature pythonPathNature = nature.getPythonPathNature();

                    //There's a catch here: if the nature uses some variable defined in the string substitution
                    //from the interpreter info, we need to do a full build instead of only making a notification.
                    String complete = pythonPathNature.getProjectExternalSourcePath(false)
                            + pythonPathNature.getProjectSourcePath(false);

                    PythonNature n = (PythonNature) nature;
                    String projectInterpreterName = n.getProjectInterpreterName();
                    IInterpreterInfo info;
                    if (IPythonNature.DEFAULT_INTERPRETER.equals(projectInterpreterName)) {
                        //if it's the default, let's translate it to the outside world
                        info = defaultInterpreterInfo;
                    } else {
                        synchronized (lock) {
                            info = exeToInfo.get(projectInterpreterName);
                        }
                    }

                    boolean makeCompleteRebuild = false;
                    if (info != null) {
                        Properties stringSubstitutionVariables = info.getStringSubstitutionVariables();
                        if (stringSubstitutionVariables != null) {
                            Enumeration<Object> keys = stringSubstitutionVariables.keys();
                            while (keys.hasMoreElements()) {
                                Object key = keys.nextElement();
                                buf.clear();
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

                return PydevPlugin.getImageCache().get(UIConstants.PY_INTERPRETER_ICON);
            }

            public String getText(Object element) {
                if (element != null && element instanceof IInterpreterInfo) {
                    IInterpreterInfo info = (IInterpreterInfo) element;
                    return info.getNameForUI();
                }
                return super.getText(element);
            }
        };
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

        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);
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

            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",
                        interpreterInfo);
                page.setWizard(this.getWizard());
View Full Code Here

Examples of org.python.pydev.core.IInterpreterInfo

      skip.add(info.getExecutableOrJar());
    }

    String path = commandLine.getValue(Options.PATH_OPTION);
    if (!skip.contains(path)){
      IInterpreterInfo info = manager.createInterpreterInfo(
          path, new NullProgressMonitor(), false);
      if (commandLine.hasOption(Options.NAME_OPTION)){
        info.setName(commandLine.getValue(Options.NAME_OPTION));
      }else{
        info.setName(FileUtils.getBaseName(path).replace(".exe", ""));
      }

      IInterpreterInfo[] updated = new IInterpreterInfo[existing.length + 1];
      System.arraycopy(existing, 0, updated, 0, existing.length);
      updated[updated.length - 1] = info;
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.