Package org.python.pydev.core

Examples of org.python.pydev.core.IPythonNature


                            System.out.println("findLikelyModulesWithChildren: " + declaringModuleName);
                        }

                        IModule module = null;

                        IPythonNature pythonNature = null;
                        if (additionalInfo instanceof AdditionalProjectInterpreterInfo) {
                            AdditionalProjectInterpreterInfo projectInterpreterInfo = (AdditionalProjectInterpreterInfo) additionalInfo;
                            pythonNature = PythonNature.getPythonNature(projectInterpreterInfo.getProject());

                        }
                        if (pythonNature == null) {
                            pythonNature = request.nature;
                        }
                        module = pythonNature.getAstManager().getModule(declaringModuleName.name, pythonNature, false);
                        if (module == null && pythonNature != request.nature) {
                            module = request.nature.getAstManager().getModule(declaringModuleName.name, request.nature,
                                    false);
                        }
View Full Code Here


                        //too many matches for that...
                        throw new TooManyMatchesException("Too Many matches (" + tokensEqualTo.size()
                                + ") were found for the requested token:" + lookForInterface, tokensEqualTo.size());
                    }
                    request.communicateWork(com.aptana.shared_core.string.StringUtils.format("Found: %s possible matches.", tokensEqualTo.size()));
                    IPythonNature nature = request.nature;
                    for (IInfo info : tokensEqualTo) {
                        AnalysisPlugin.getDefinitionFromIInfo(pointers, manager, nature, info, completionCache);
                        request.checkCancelled();
                    }
                } catch (MisconfigurationException e) {
View Full Code Here

     * @param root the workspace root.
     * @return an object capable on making string substitutions based on variables in the project and in the workspace.
     */
    public StringSubstitution getStringSubstitution(IWorkspaceRoot root) {
        IResource resource = root.findMember(fProjectName);
        IPythonNature nature = null;
        if (resource instanceof IProject) {
            nature = PythonNature.getPythonNature(resource);
        }

        StringSubstitution stringSubstitution = new StringSubstitution(nature);
View Full Code Here

    checkScriptPath();
    if(mainViewer == null){
      return null;
    }
    PyEdit pyEdit = ((PySourceViewer)mainViewer).getEdit();
    IPythonNature nature;
    try {
      nature = pyEdit.getPythonNature();
      if (nature == null)
      {
        return null;
View Full Code Here

                .performPythonpathStringSubstitution("aa${unknown}bb"));
    }

    //Just creating stub...
    private StringSubstitution createStringSubstitution(final Map<String, String> variableSubstitution) {
        StringSubstitution s = new StringSubstitution(new IPythonNature() {

            public void endRequests() {
                throw new RuntimeException("Not implemented");
            }
View Full Code Here

    private void configureEditorButton() {
        boolean enabled = false;
        String text;
        try {
            if (this.activeEditor != null) {
                IPythonNature nature = this.activeEditor.getPythonNature();
                if (nature != null) {

                    if (nature.getRelatedInterpreterManager().getDefaultInterpreterInfo(false) != null) {
                        text = "Console for currently active editor";
                        enabled = true;
                    } else {
                        throw new NotConfiguredInterpreterException();
                    }
View Full Code Here

    public Tuple<Collection<String>, IPythonNature> getPythonpathAndNature(IInterpreterInfo interpreter) {

        if (this.interpreterManager != null) {
            if (this.natures.size() == 1) {
                //chosen for the editor
                IPythonNature nature = this.natures.get(0);
                return new Tuple<Collection<String>, IPythonNature>(new ArrayList<String>(nature.getPythonPathNature()
                        .getCompleteProjectPythonPath(interpreter, this.interpreterManager)), nature);

            }

            // collect all the python path (no duplicates, hence a set)
            HashSet<String> pythonpath = new LinkedHashSet<String>();

            // Add all the paths in the interpreter (note: it's important that this goes before the
            // path for the other natures so that if we have something as IPython, the one used will
            // be the one from the interpreter).
            pythonpath.addAll(interpreter.getPythonPath());

            //we need to get the natures matching the one selected in all the projects.
            IWorkspace w = ResourcesPlugin.getWorkspace();
            for (IProject p : w.getRoot().getProjects()) {
                PythonNature nature = PythonNature.getPythonNature(p);
                try {
                    if (nature != null) {
                        if (nature.getRelatedInterpreterManager() == this.interpreterManager) {
                            natures.add(nature);
                            List<String> completeProjectPythonPath = nature.getPythonPathNature()
                                    .getCompleteProjectPythonPath(interpreter, this.interpreterManager);
                            if (completeProjectPythonPath != null) {
                                pythonpath.addAll(completeProjectPythonPath);
                            } else {
                                Log.logInfo("Unable to get pythonpath for project: " + nature.getProject()
                                        + " (initialization not finished).");
                            }
                        }
                    }
                } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.python.pydev.core.IPythonNature

Copyright © 2018 www.massapicom. 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.