From 1e0d7d60a5022ab6c1c30d6e17617af0020e6604 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 Nov 2020 17:14:18 +0100 Subject: [PATCH] Bugfixes --- src/sh_edraft/hosting/application_host.py | 5 +++-- src/sh_edraft/hosting/hosting_environment.py | 10 +++++++++- src/tests_dev/main.py | 4 +--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/sh_edraft/hosting/application_host.py b/src/sh_edraft/hosting/application_host.py index f0f611f2..e9a4ecc4 100644 --- a/src/sh_edraft/hosting/application_host.py +++ b/src/sh_edraft/hosting/application_host.py @@ -1,3 +1,4 @@ +import sys from datetime import datetime from sh_edraft.hosting.hosting_environment import HostingEnvironment @@ -9,12 +10,12 @@ from sh_edraft.service.service_provider import ServiceProvider class ApplicationHost(ApplicationHostBase): - def __init__(self, name: str, args: list[str]): + def __init__(self, name: str): ApplicationHostBase.__init__(self) self._name: str = name self._environment = HostingEnvironment() - self._args: list[str] = args + self._args: list[str] = sys.argv self._services = ServiceProvider(self) self._start_time: datetime = datetime.now() self._end_time: datetime = datetime.now() diff --git a/src/sh_edraft/hosting/hosting_environment.py b/src/sh_edraft/hosting/hosting_environment.py index 763ef5cc..91c011d0 100644 --- a/src/sh_edraft/hosting/hosting_environment.py +++ b/src/sh_edraft/hosting/hosting_environment.py @@ -6,7 +6,7 @@ from sh_edraft.hosting.model.environment_name import EnvironmentName class HostingEnvironment(EnvironmentBase): - def __init__(self, name: EnvironmentName = None, crp: str = None): + def __init__(self, name: EnvironmentName = None, crp: str = './'): EnvironmentBase.__init__(self) self._name: Optional[EnvironmentName] = name @@ -16,6 +16,14 @@ class HostingEnvironment(EnvironmentBase): def name(self) -> EnvironmentName: return self._name + @name.setter + def name(self, name: EnvironmentName): + self._name = name + @property def content_root_path(self) -> str: return self._content_root_path + + @content_root_path.setter + def content_root_path(self, content_root_path: str): + self._content_root_path = content_root_path diff --git a/src/tests_dev/main.py b/src/tests_dev/main.py index 1b9c7cd1..6516be08 100644 --- a/src/tests_dev/main.py +++ b/src/tests_dev/main.py @@ -1,5 +1,3 @@ -import sys - from sh_edraft.hosting import ApplicationHost from sh_edraft.hosting.base.application_base import ApplicationBase @@ -9,7 +7,7 @@ class Program(ApplicationBase): def __init__(self): ApplicationBase.__init__(self) - self._app_host = ApplicationHost('CPL_DEV_Test', sys.argv) + self._app_host = ApplicationHost('CPL_DEV_Test') self._config = self._app_host.services.config self._services = self._app_host.services