예제 #1
0
파일: __init__.py 프로젝트: anthrax3/ajenti
 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])
예제 #2
0
파일: __init__.py 프로젝트: anthrax3/ajenti
 def get_classes(cls):
     return manager.get_implementations(cls)
예제 #3
0
파일: __init__.py 프로젝트: anthrax3/ajenti
 def get_all(cls, context=None):
     if not context:
         context = extract_context()
     return [context.get_instance(x) for x in manager.get_implementations(cls)]