How to use the injectable.container.injection_container.InjectionContainer._register_injectable function in injectable

To help you get started, we’ve selected a few injectable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github allrod5 / injectable / injectable / injection / injectable_decorator.py View on Github external
def decorator(klass: T, direct_call: bool = False) -> T:
        steps_back = 3 if direct_call else 2
        caller_filepath = get_caller_filepath(steps_back)
        if caller_filepath == InjectionContainer.LOADING_FILEPATH:
            InjectionContainer._register_injectable(
                klass, caller_filepath, qualifier, primary, namespace, group, singleton
            )
        return klass