From 0bd2903e602e3002f707458d990b4836edbdb2ef Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Wed, 29 Sep 2021 17:01:22 -0400 Subject: [PATCH] Update quotes in single container example --- .../example/__main__.py | 4 ++-- .../example/containers.py | 4 ++-- .../example/services.py | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/miniapps/application-single-container/example/__main__.py b/examples/miniapps/application-single-container/example/__main__.py index fde43d5a..403e7cf3 100644 --- a/examples/miniapps/application-single-container/example/__main__.py +++ b/examples/miniapps/application-single-container/example/__main__.py @@ -22,10 +22,10 @@ def main( photo_service.upload_photo(user, photo) -if __name__ == '__main__': +if __name__ == "__main__": container = Container() container.init_resources() - container.config.from_ini('config.ini') + container.config.from_ini("config.ini") container.wire(modules=[__name__]) main(*sys.argv[1:]) diff --git a/examples/miniapps/application-single-container/example/containers.py b/examples/miniapps/application-single-container/example/containers.py index 7303b0f4..4fecac28 100644 --- a/examples/miniapps/application-single-container/example/containers.py +++ b/examples/miniapps/application-single-container/example/containers.py @@ -15,7 +15,7 @@ class Container(containers.DeclarativeContainer): logging = providers.Resource( logging.config.fileConfig, - fname='logging.ini', + fname="logging.ini", ) # Gateways @@ -27,7 +27,7 @@ class Container(containers.DeclarativeContainer): s3_client = providers.Singleton( boto3.client, - service_name='s3', + service_name="s3", aws_access_key_id=config.aws.access_key_id, aws_secret_access_key=config.aws.secret_access_key, ) diff --git a/examples/miniapps/application-single-container/example/services.py b/examples/miniapps/application-single-container/example/services.py index 338888e3..7f2013c3 100644 --- a/examples/miniapps/application-single-container/example/services.py +++ b/examples/miniapps/application-single-container/example/services.py @@ -11,7 +11,7 @@ class BaseService: def __init__(self) -> None: self.logger = logging.getLogger( - f'{__name__}.{self.__class__.__name__}', + f"{__name__}.{self.__class__.__name__}", ) @@ -22,8 +22,8 @@ class UserService(BaseService): super().__init__() def get_user(self, email: str) -> Dict[str, str]: - self.logger.debug('User %s has been found in database', email) - return {'email': email, 'password_hash': '...'} + self.logger.debug("User %s has been found in database", email) + return {"email": email, "password_hash": "..."} class AuthService(BaseService): @@ -36,8 +36,8 @@ class AuthService(BaseService): def authenticate(self, user: Dict[str, str], password: str) -> None: assert password is not None self.logger.debug( - 'User %s has been successfully authenticated', - user['email'], + "User %s has been successfully authenticated", + user["email"], ) @@ -50,7 +50,7 @@ class PhotoService(BaseService): def upload_photo(self, user: Dict[str, str], photo_path: str) -> None: self.logger.debug( - 'Photo %s has been successfully uploaded by user %s', + "Photo %s has been successfully uploaded by user %s", photo_path, - user['email'], + user["email"], )