Package org.python.pydev.editor.codecompletion.revisited

Examples of org.python.pydev.editor.codecompletion.revisited.PythonPathHelper


            buffer.append(com.aptana.shared_core.string.StringUtils.format("Unable to get additional project info for: %s (gotten null)",
                    nature.getProject()));
            info.allOk = false;
        }

        PythonPathHelper pythonPathHelper = (PythonPathHelper) info.modulesManager.getPythonPathHelper();
        List<String> pythonpath = pythonPathHelper.getPythonpath();
        buffer.append(com.aptana.shared_core.string.StringUtils
                .format("Checking the integrity of the project: %s\n\n", nature.getProject().getName()));
        buffer.append("Pythonpath:\n");
        for (String string : pythonpath) {
            buffer.append(string);
            buffer.append("\n");
        }
        buffer.append("\n");

        HashSet<ModulesKey> expectedModuleNames = new HashSet<ModulesKey>();
        for (String string : pythonpath) {
            File file = new File(string);
            if (file.exists() && file.isDirectory()) { //TODO: Handle zip file modules!
                Collection<PyFileInfo> modulesBelow = pythonPathHelper.getModulesBelow(file, monitor)
                        .getFoundPyFileInfos();
                for (PyFileInfo fileInfo : modulesBelow) {
                    File moduleFile = fileInfo.getFile();
                    String modName = pythonPathHelper.resolveModule(FileUtils.getFileAbsolutePath(moduleFile), true);
                    if (modName != null) {
                        expectedModuleNames.add(new ModulesKey(modName, moduleFile));
                        buffer.append(com.aptana.shared_core.string.StringUtils.format("Found module: %s - %s\n", modName, moduleFile));
                    } else {
                        if (PythonPathHelper.isValidModuleLastPart(StringUtils.stripExtension((moduleFile.getName())))) {
View Full Code Here


                IStatus ret = checkEarlyReturn(monitor, builder);
                if (ret != null) {
                    continue;
                }

                PythonPathHelper pythonPathHelper = new PythonPathHelper();
                pythonPathHelper.setPythonPath(builder.info.libs);
                ModulesFoundStructure modulesFound = pythonPathHelper.getModulesFoundStructure(monitor);
                ret = checkEarlyReturn(monitor, builder);
                if (ret != null) {
                    continue;
                }
View Full Code Here

        if (projectModulesManager == null) {
            addLeaf("Modules manager == null (should happen only in the plugin initialization) -- skipping other checks.");
            return;
        }

        PythonPathHelper pythonPathHelper = (PythonPathHelper) projectModulesManager.getPythonPathHelper();
        if (pythonPathHelper == null) {
            addLeaf("PythonPathHelper == null (should happen only in the plugin initialization) -- skipping other checks.");
            return;
        }
        List<String> pythonpath = pythonPathHelper.getPythonpath();
        for (String s : pythonpath) {
            addLeaf("PYTHONPATH: " + s);
        }

        HashSet<ModulesKey> expectedModuleNames = new HashSet<ModulesKey>();
        for (String string : pythonpath) {
            File file = new File(string);
            if (file.isDirectory()) { //TODO: Handle zip file modules!
                Collection<PyFileInfo> modulesBelow = pythonPathHelper.getModulesBelow(file, new NullProgressMonitor())
                        .getFoundPyFileInfos();
                for (PyFileInfo fileInfo : modulesBelow) {
                    File moduleFile = fileInfo.getFile();
                    String modName = pythonPathHelper.resolveModule(FileUtils.getFileAbsolutePath(moduleFile), true);
                    if (modName != null) {
                        expectedModuleNames.add(new ModulesKey(modName, moduleFile));
                    } else {
                        if (PythonPathHelper.isValidModuleLastPart(StringUtils.stripExtension((moduleFile.getName())))) {
                            addLeaf(com.aptana.shared_core.string.StringUtils.format("Unable to resolve module: %s (gotten null module name)",
View Full Code Here

                return false;
            }
        });

        assertTrue(nature.getAstManager() != null);
        PythonPathHelper pythonPathHelper = (PythonPathHelper) nature.getAstManager().getModulesManager()
                .getPythonPathHelper();
        List<String> lst = new ArrayList<String>();
        lst.add(FileUtils.getFileAbsolutePath(srcLocFile));
        assertEquals(lst, pythonPathHelper.getPythonpath());

    }
View Full Code Here

                        ISystemModulesManager modulesManager = info.getModulesManager();
                        Object pythonPathHelper = modulesManager.getPythonPathHelper();
                        if (!(pythonPathHelper instanceof PythonPathHelper)) {
                            continue;
                        }
                        PythonPathHelper pathHelper = (PythonPathHelper) pythonPathHelper;
                        List<String> pythonpath = pathHelper.getPythonpath();
                        if (pythonpath == null || pythonpath.size() == 0) {
                            continue;
                        }
                        modulesManager.save();
                    } catch (Throwable e) {
View Full Code Here

        manager.addModule(new ModulesKey("bar", new File("bar.py")));
        manager.addModule(new ModulesKey("foo", new File("foo.py")));
        manager.addModule(new ModulesKey("empty", null));
        manager.addModule(new ModulesKeyForZip("zip", new File("zip.zip"), "path", true));

        PythonPathHelper pythonPathHelper = manager.getPythonPathHelper();
        pythonPathHelper.setPythonPath("rara|boo");
        assertEquals(Arrays.asList("rara", "boo"), manager.getPythonPathHelper().getPythonpath());

        File f = new File("modules_manager_testing.temporary_dir");
        try {
            FileUtils.deleteDirectoryTree(f);
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.codecompletion.revisited.PythonPathHelper

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.