From 41ddc8696147118d44a91aa16d4327ee28858d40 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 29 Mar 2021 12:16:12 +0200 Subject: [PATCH] Bugfixes --- src/cpl_cli/templates/new/console/src/startup.py | 9 ++++----- src/tests/generated/startup-app/src/startup.py | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cpl_cli/templates/new/console/src/startup.py b/src/cpl_cli/templates/new/console/src/startup.py index b7b44e0e..89a1cf40 100644 --- a/src/cpl_cli/templates/new/console/src/startup.py +++ b/src/cpl_cli/templates/new/console/src/startup.py @@ -13,14 +13,14 @@ class StartupTemplate(TemplateFileABC): self._value = textwrap.dedent("""\ from cpl.application import StartupABC from cpl.configuration import ConfigurationABC - from cpl.dependency_injection import ServiceProviderABC + from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC class Startup(StartupABC): - def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC): StartupABC.__init__(self) - + self._configuration = config self._environment = self._configuration.environment self._services = services @@ -29,8 +29,7 @@ class StartupTemplate(TemplateFileABC): return self._configuration def configure_services(self) -> ServiceProviderABC: - return self._services - + return self._services.build_service_provider() """) @property diff --git a/src/tests/generated/startup-app/src/startup.py b/src/tests/generated/startup-app/src/startup.py index 5b8ef5af..07f5dece 100644 --- a/src/tests/generated/startup-app/src/startup.py +++ b/src/tests/generated/startup-app/src/startup.py @@ -1,11 +1,11 @@ from cpl.application import StartupABC from cpl.configuration import ConfigurationABC -from cpl.dependency_injection import ServiceProviderABC +from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC class Startup(StartupABC): - def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC): StartupABC.__init__(self) self._configuration = config @@ -16,5 +16,5 @@ class Startup(StartupABC): return self._configuration def configure_services(self) -> ServiceProviderABC: - return self._services + return self._services.build_service_provider()