How to use the injectable.container.injectable.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 / container / injection_container.py View on Github external
def _register_injectable(
        cls,
        klass: type,
        filepath: str,
        qualifier: str = None,
        primary: bool = False,
        namespace: str = None,
        group: str = None,
        singleton: bool = False,
    ):
        unique_id = f"{klass.__qualname__}@{filepath}"
        injectable = Injectable(klass, unique_id, primary, group, singleton)
        namespace_entry = cls._get_namespace_entry(
            namespace or cls.LOADING_DEFAULT_NAMESPACE
        )
        namespace_entry.register_injectable(injectable, klass, qualifier)
github allrod5 / injectable / injectable / container / injection_container.py View on Github external
def _register_factory(
        cls,
        factory: Callable,
        filepath: str,
        dependency: Optional[type] = None,
        qualifier: str = None,
        primary: bool = False,
        namespace: str = None,
        group: str = None,
        singleton: bool = False,
    ):
        unique_id = f"{factory.__qualname__}@{filepath}"
        injectable = Injectable(factory, unique_id, primary, group, singleton)
        namespace_entry = cls._get_namespace_entry(
            namespace or cls.LOADING_DEFAULT_NAMESPACE
        )
        namespace_entry.register_injectable(injectable, dependency, qualifier)
github allrod5 / injectable / injectable / container / namespace.py View on Github external
def __init__(self):
        self.class_registry: Dict[str, Set[Injectable]] = {}
        self.qualifier_registry: Dict[str, Set[Injectable]] = {}