def setup_repos(self): import repositories from repositories import all as repos repos = list(repos) repos.reverse() self.repos = repos return
def _importComponent( self, key ): from repositories import all as repos repos = list(repos) # look in the last repository first repos.reverse() category, type = key module = None for repo in repos: modulename = '%s.%s.%s' % ( repo, category, type ) try: module = __import__( modulename, {}, {}, [''] ) except: continue break if module: self.register( category, type, module ) else: raise NotRegisteredError, "component %r of category %r " % (type, category) return module
def _importComponent(self, key): from repositories import all as repos repos = list(repos) # look in the last repository first repos.reverse() category, type = key module = None for repo in repos: modulename = '%s.%s.%s' % (repo, category, type) try: module = __import__(modulename, {}, {}, ['']) except: continue break if module: self.register(category, type, module) else: raise NotRegisteredError, "component %r of category %r " % ( type, category) return module