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 "", ""
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)