Exemple #1
0
 def setup_repos(self):
     import repositories
     from repositories import all as repos
     repos = list(repos)
     repos.reverse()
     self.repos = repos
     return
Exemple #2
0
    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
Exemple #3
0
    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