pydio.injector - Dependency injector
- class pydio.injector.Injector(provider: IUnboundFactoryRegistry, env: Optional[Hashable] = None)
Bases:
IInjectorDependency injector main class.
- Parameters
provider – Unbound factory provider to work on
env –
Name of the environment this injector will use when making queries to
IUnboundFactoryRegistryobject given via provider.This can be obtained f.e. from environment variable. Once injector is created you will not be able to change this.
See
IUnboundFactoryRegistry.get()for more details.
- exception AlreadyClosedError(**kwargs)
Bases:
InjectorErrorRaised when operation on a closed injector was performed.
- exception NoProviderFoundError(key, env)
Bases:
InjectorErrorRaised when there was no matching provider found for given key.
- Parameters
key – Searched key
env – Searched environment
- exception OutOfScopeError(key, scope, required_scope)
Bases:
InjectorErrorRaised when there was attempt to create object that was registered for different scope.
- Parameters
key – Searched key
scope – Injector’s own scope
required_scope – Required scope
- inject(key)
See
IInjector.inject.