Ejemplo n.º 1
0
    def get(self, what, default=internal.raiseOnMissing):
        ret = default
        try:
            log.debug("Resolving '%s'", what)

            ip = inject_param(what)
            bound = self._binds.get(what)

            ctx = InjectionContext(self._binds, bound, ip)
            ret = ctx.activate()
        except InjectionError:
            if default == internal.raiseOnMissing:
                raise

        log.debug("IoC '%s' resolved to '%s'", what, ret)
        return ret