def get(cls, context=None): if not context: context = extract_context() impls = manager.get_implementations(cls) if len(impls) == 0: raise NoImplementationsError('Implementations for %s not found' % cls.__name__) return context.get_instance(impls[0])
def get_classes(cls): return manager.get_implementations(cls)
def get_all(cls, context=None): if not context: context = extract_context() return [context.get_instance(x) for x in manager.get_implementations(cls)]