How to use the injectable.container.injection_container.InjectionContainer.LOADING_FILEPATH 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
github allrod5 / injectable / injectable / injection / injectable_factory_decorator.py View on Github external
def decorator(fn: Callable[..., T]) -> Callable[..., T]:
        caller_filepath = get_caller_filepath()
        if caller_filepath == InjectionContainer.LOADING_FILEPATH:
            InjectionContainer._register_factory(
                fn,
                caller_filepath,
                dependency,
                qualifier,
                primary,
                namespace,
                group,
                singleton,
            )
        return fn