Package org.python.pydev.navigator.elements

Examples of org.python.pydev.navigator.elements.ProjectConfigError


        } else if (object instanceof TreeNode<?>) {
            TreeNode<?> treeNode = (TreeNode<?>) object;
            return treeNode.getParent();

        } else if (object instanceof ProjectConfigError) {
            ProjectConfigError configError = (ProjectConfigError) object;
            return configError.getParent();

        }

        if (DEBUG) {
            System.out.println("getPipelinedParent RETURN: " + aSuggestedParent);
View Full Code Here


        if (IN_TESTS) {
            return new Tuple<List<ProjectConfigError>, IInterpreterInfo>(new ArrayList<ProjectConfigError>(), null);
        }
        ArrayList<ProjectConfigError> lst = new ArrayList<ProjectConfigError>();
        if (this.project == null) {
            lst.add(new ProjectConfigError(relatedToProject, "The configured nature has no associated project."));
        }
        IInterpreterInfo info = null;
        try {
            info = this.getProjectInterpreter();

            String executableOrJar = info.getExecutableOrJar();
            if (!new File(executableOrJar).exists()) {
                lst.add(new ProjectConfigError(relatedToProject,
                        "The interpreter configured does not exist in the filesystem: " + executableOrJar));
            }

            List<String> projectSourcePathSet = new ArrayList<String>(this.getPythonPathNature()
                    .getProjectSourcePathSet(true));
            Collections.sort(projectSourcePathSet);
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

            for (String path : projectSourcePathSet) {
                if (path.trim().length() > 0) {
                    IPath p = new Path(path);
                    IResource resource = root.findMember(p);
                    if (resource == null) {
                        relatedToProject.refreshLocal(p.segmentCount(), null);
                        resource = root.findMember(p); //2nd attempt (after refresh)
                    }
                    if (resource == null || !resource.exists()) {
                        lst.add(new ProjectConfigError(relatedToProject, "Source folder: " + path + " not found"));
                    }
                }
            }

            List<String> externalPaths = this.getPythonPathNature().getProjectExternalSourcePathAsList(true);
            Collections.sort(externalPaths);
            for (String path : externalPaths) {
                if (!new File(path).exists()) {
                    lst.add(new ProjectConfigError(relatedToProject, "Invalid external source folder specified: "
                            + path));
                }
            }

            Tuple<String, String> versionAndError = getVersionAndError();
            if (versionAndError.o2 != null) {
                lst.add(new ProjectConfigError(relatedToProject, StringUtils.replaceNewLines(versionAndError.o2, " ")));
            }

        } catch (MisconfigurationException e) {
            lst.add(new ProjectConfigError(relatedToProject, StringUtils.replaceNewLines(e.getMessage(), " ")));

        } catch (Throwable e) {
            lst.add(new ProjectConfigError(relatedToProject, StringUtils.replaceNewLines(
                    "Unexpected error:" + e.getMessage(), " ")));
        }
        return new Tuple<List<ProjectConfigError>, IInterpreterInfo>(lst, info);
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.navigator.elements.ProjectConfigError

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.