Exemplo n.º 1
0
 def getMethodInjectors(clazz):
     members = (m for n, m in inspect.getmembers(clazz, inspect.ismethod))
     methods = (m for m in members if m.__name__ != '__init__')
     setters = (m for m in methods if hasattr(m, internal.INJECT_ATTR))
     return [MethodInjector(clazz, m, inject.getParams(m)) for m in setters]
Exemplo n.º 2
0
 def getPropertyInjectors(clazz):
     props = [(n, p) for n, p in inspect.getmembers(clazz) if isinstance(p, property)]
     setters = ((n, p) for n, p in props if p.fset and hasattr(p.fset, internal.INJECT_ATTR))
     return [PropertyInjector(clazz, n, p, inject.getParams(p.fset)) for n, p in setters]
Exemplo n.º 3
0
 def getClassActivator(clazz):
     ips = inject.getParams(clazz.__init__)
     return ClassInitActivator(clazz, ips)