From 35864f476fb2fa1a89a2e715e88e43864e16006b Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Wed, 29 Sep 2021 17:06:53 -0400 Subject: [PATCH] Update single and multiple containers example --- .../example/__main__.py | 2 +- .../example/containers.py | 8 ++++---- .../example/services.py | 2 +- .../application-multiple-containers/example/__main__.py | 2 +- .../application-single-container/example/__main__.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/miniapps/application-multiple-containers-runtime-overriding/example/__main__.py b/examples/miniapps/application-multiple-containers-runtime-overriding/example/__main__.py index 2175884b..96b019f1 100644 --- a/examples/miniapps/application-multiple-containers-runtime-overriding/example/__main__.py +++ b/examples/miniapps/application-multiple-containers-runtime-overriding/example/__main__.py @@ -3,7 +3,7 @@ from .containers import Application -if __name__ == '__main__': +if __name__ == "__main__": application = Application() config = application.service.config() config.build() diff --git a/examples/miniapps/application-multiple-containers-runtime-overriding/example/containers.py b/examples/miniapps/application-multiple-containers-runtime-overriding/example/containers.py index 35ec4035..ae29d4ff 100644 --- a/examples/miniapps/application-multiple-containers-runtime-overriding/example/containers.py +++ b/examples/miniapps/application-multiple-containers-runtime-overriding/example/containers.py @@ -6,17 +6,17 @@ from .services import ConfigService class Core(containers.DeclarativeContainer): - config = providers.Configuration('config') + config = providers.Configuration("config") class Storage(containers.DeclarativeContainer): - queue = providers.Singleton(lambda: 'Some storage') + queue = providers.Singleton(lambda: "Some storage") class Adapter(containers.DeclarativeContainer): core = providers.DependenciesContainer(config=providers.Configuration()) tinydb = providers.Singleton( - lambda db_path: f'DB Path=[{db_path}]', + lambda db_path: f"DB Path=[{db_path}]", db_path=core.config.default.db_path, ) @@ -25,7 +25,7 @@ class Repository(containers.DeclarativeContainer): adapter = providers.DependenciesContainer() storage = providers.DependenciesContainer() site = providers.Singleton( - lambda adapter, queue: f'Adapter=[{adapter}], queue=[{queue}]', + lambda adapter, queue: f"Adapter=[{adapter}], queue=[{queue}]", adapter=adapter.tinydb, queue=storage.queue, ) diff --git a/examples/miniapps/application-multiple-containers-runtime-overriding/example/services.py b/examples/miniapps/application-multiple-containers-runtime-overriding/example/services.py index e0901e13..f791ba54 100644 --- a/examples/miniapps/application-multiple-containers-runtime-overriding/example/services.py +++ b/examples/miniapps/application-multiple-containers-runtime-overriding/example/services.py @@ -6,4 +6,4 @@ class ConfigService: self._config = config def build(self): - self._config.from_dict({'default': {'db_path': '~/test'}}) + self._config.from_dict({"default": {"db_path": "~/test"}}) diff --git a/examples/miniapps/application-multiple-containers/example/__main__.py b/examples/miniapps/application-multiple-containers/example/__main__.py index 08331eeb..adf91ae8 100644 --- a/examples/miniapps/application-multiple-containers/example/__main__.py +++ b/examples/miniapps/application-multiple-containers/example/__main__.py @@ -2,7 +2,7 @@ import sys -from dependency_injector.wiring import inject, Provide +from dependency_injector.wiring import Provide, inject from .services import UserService, AuthService, PhotoService from .containers import Application diff --git a/examples/miniapps/application-single-container/example/__main__.py b/examples/miniapps/application-single-container/example/__main__.py index 403e7cf3..5104249b 100644 --- a/examples/miniapps/application-single-container/example/__main__.py +++ b/examples/miniapps/application-single-container/example/__main__.py @@ -2,7 +2,7 @@ import sys -from dependency_injector.wiring import inject, Provide +from dependency_injector.wiring import Provide, inject from .services import UserService, AuthService, PhotoService from .containers import Container