Exemplo n.º 1
0
    def sectionFromPath(self, sEntryPath, library=None):

        sEntryPath = normCase(sEntryPath)
        sEntryPathDirs = pathSplitDirs(normCase(sEntryPath))

        sectionDataList = sorted(self.iterSectionPaths(library=library),
                                 key=lambda x: len(x[2]),
                                 reverse=True)

        for sSpace, sSection, sSectionPath in sectionDataList:
            if pathStartsWith(sEntryPath, sSectionPath, pathSplits=sEntryPathDirs):
                return sSpace, sSection

        return "", ""
Exemplo n.º 2
0
    def _checkTemplatePaths(self, out_invalidPaths, sSection="project"):

        sTemplateDir = self.getTemplateDir(sSection)
        if sTemplateDir:

            sEntityDir = self.getPath("template", sSection, "entity_dir")

            for _, sRcPath in self.iterRcPaths("template", sSection):

                if not pathStartsWith(sRcPath, sEntityDir):
                    continue

                sRcPath = pathRedir(sRcPath, sEntityDir, sTemplateDir)

                if osp.exists(sRcPath):
                    continue

                out_invalidPaths.append(sRcPath)

        for sChildSection in self.getVar(sSection, "child_sections", ()):
            self._checkTemplatePaths(out_invalidPaths, sChildSection)