def gatherComponents(self): """ This Method Gather The Components. """ if self.paths: self._components = {} walker = Walker() for path in self.paths.keys(): walker.root = self.paths[path] walker.walk(("\.{0}$".format(self._extension),), ("\._",)) for component in walker.files.keys(): LOGGER.debug("> Current Component : '{0}'.".format(component)) profile = self.getProfile(walker.files[component]) if profile: if os.path.isfile(os.path.join(profile.path, profile.module) + ".py"): self._components[profile.name] = profile else: LOGGER.warning( "!> {0} | '{1}' Has No Associated Module And Has Been Rejected !".format( self.__class__.__name__, component ) ) continue else: LOGGER.warning( "!> {0} | '{1}' Is Not A Valid Component And Has Been Rejected !".format( self.__class__.__name__, component ) ) else: raise foundations.exceptions.ProgrammingError("'{0}' Has No Components Paths Defined !".format(self))
def getTemplatesReleases(): ''' This Definition Gets Templates Releases. ''' walker = Walker() walker.root = TEMPLATES_PATH templates = walker.walk( ( TEMPLATES_EXTENSION, ), ( "\._", ) ) for template in sorted( templates.keys() ) : parser = Parser( templates[template] ) parser.read() and parser.parse() LOGGER.info( "{0} | '{1}' : '{2}' !".format( getTemplatesReleases.__name__, template, foundations.parser.getAttributeCompound( "Release", parser.getValue( "Release", "Template", encode = True ) ).value ) )