This commit is contained in:
Sven Heidemann 2021-03-19 14:20:57 +01:00
parent e2e763a424
commit bfa029f207
6 changed files with 19 additions and 12 deletions

View File

@ -14,7 +14,8 @@ class ApplicationBuilder(ApplicationBuilderABC):
"""
Builder class for application
"""
ApplicationBuilderABC.__init__(self, app)
ApplicationBuilderABC.__init__(self)
self._app = app
self._startup: Optional[StartupABC] = None
self._configuration = Configuration()

View File

@ -7,11 +7,10 @@ from cpl.application.startup_abc import StartupABC
class ApplicationBuilderABC(ABC):
def __init__(self, app: Type[ApplicationABC]):
def __init__(self, *args):
"""
ABC of application builder
"""
self._app = app
@abstractmethod
def use_startup(self, startup: Type[StartupABC]):

View File

@ -1,6 +1,5 @@
from abc import ABC, abstractmethod
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
from cpl.configuration.configuration_abc import ConfigurationABC
from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
@ -8,15 +7,11 @@ from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
class StartupABC(ABC):
@abstractmethod
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
def __init__(self, *args):
"""
ABC for a startup class
"""
self._configuration = config
self._application_runtime = runtime
self._services = services
@abstractmethod
def configure_configuration(self) -> ConfigurationABC:
"""

View File

@ -23,7 +23,11 @@ from cpl_cli.publish.publisher_abc import PublisherABC
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
StartupABC.__init__(self, config, runtime, services)
StartupABC.__init__(self)
self._configuration = config
self._application_runtime = runtime
self._services = services
self._application_runtime.set_runtime_directory(__file__)

View File

@ -20,7 +20,11 @@ class StartupTemplate(TemplateFileABC):
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
StartupABC.__init__(self, config, runtime, services)
StartupABC.__init__(self)
self._configuration = config
self._application_runtime = runtime
self._services = services
def configure_configuration(self) -> ConfigurationABC:
return self._configuration

View File

@ -14,7 +14,11 @@ from cpl.utils.credential_manager import CredentialManager
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
StartupABC.__init__(self, config, runtime, services)
StartupABC.__init__(self)
self._configuration = config
self._application_runtime = runtime
self._services = services
def configure_configuration(self) -> ConfigurationABC:
self._configuration.add_environment_variables('PYTHON_')