mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-23 05:56:19 +03:00
Implement .from_value() method for config provider
This commit is contained in:
parent
bbd623c719
commit
f9b0471252
File diff suppressed because it is too large
Load Diff
|
@ -205,6 +205,7 @@ class ConfigurationOption(Provider[Any]):
|
|||
def from_pydantic(self, settings: PydanticSettings, required: bool = False, **kwargs: Any) -> None: ...
|
||||
def from_dict(self, options: _Dict[str, Any], required: bool = False) -> None: ...
|
||||
def from_env(self, name: str, default: Optional[Any] = None, required: bool = False) -> None: ...
|
||||
def from_value(self, value: Any) -> None: ...
|
||||
|
||||
|
||||
class TypedConfigurationOption(Callable[T]):
|
||||
|
@ -241,6 +242,7 @@ class Configuration(Object[Any]):
|
|||
def from_pydantic(self, settings: PydanticSettings, required: bool = False, **kwargs: Any) -> None: ...
|
||||
def from_dict(self, options: _Dict[str, Any], required: bool = False) -> None: ...
|
||||
def from_env(self, name: str, default: Optional[Any] = None, required: bool = False) -> None: ...
|
||||
def from_value(self, value: Any) -> None: ...
|
||||
|
||||
|
||||
class Factory(Provider[T]):
|
||||
|
|
|
@ -1698,6 +1698,16 @@ cdef class ConfigurationOption(Provider):
|
|||
|
||||
self.override(value)
|
||||
|
||||
def from_value(self, value):
|
||||
"""Load configuration value.
|
||||
|
||||
:param value: Configuration value
|
||||
:type value: object
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
self.override(value)
|
||||
|
||||
@property
|
||||
def related(self):
|
||||
"""Return related providers generator."""
|
||||
|
@ -2104,6 +2114,16 @@ cdef class Configuration(Object):
|
|||
|
||||
self.override(value)
|
||||
|
||||
def from_value(self, value):
|
||||
"""Load configuration value.
|
||||
|
||||
:param value: Configuration value
|
||||
:type value: object
|
||||
|
||||
:rtype: None
|
||||
"""
|
||||
self.override(value)
|
||||
|
||||
@property
|
||||
def related(self):
|
||||
"""Return related providers generator."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user