From d72514205c642f0fd739ef4469a7fcb44f693eb1 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 5 Apr 2023 18:13:29 +0200 Subject: [PATCH] Updated PipSettings --- tools/set_pip_urls/pip_settings.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tools/set_pip_urls/pip_settings.py b/tools/set_pip_urls/pip_settings.py index a89be92c..233abc4d 100644 --- a/tools/set_pip_urls/pip_settings.py +++ b/tools/set_pip_urls/pip_settings.py @@ -1,18 +1,13 @@ -import traceback - -from cpl_core.environment.environment_name_enum import EnvironmentNameEnum - from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC -from cpl_core.console import Console class PIPSettings(ConfigurationModelABC): - def __init__(self): + def __init__(self, production: str = None, staging: str = None, development: str = None): ConfigurationModelABC.__init__(self) - self._production = "" - self._staging = "" - self._development = "" + self._production = production + self._staging = staging + self._development = development @property def production(self): @@ -25,12 +20,3 @@ class PIPSettings(ConfigurationModelABC): @property def development(self): return self._development - - def from_dict(self, settings: dict): - try: - self._production = settings[EnvironmentNameEnum.production.value] - self._staging = settings[EnvironmentNameEnum.staging.value] - self._development = settings[EnvironmentNameEnum.development.value] - except Exception as e: - Console.error(f"[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings") - Console.error(f"[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}")