Fixed post script

This commit is contained in:
Sven Heidemann 2023-09-28 18:59:06 +02:00
parent ebc782e266
commit b2b5b1b3d0
3 changed files with 6 additions and 18 deletions

View File

@ -22,9 +22,7 @@
"cpl-cli>=2023.4.0.post3" "cpl-cli>=2023.4.0.post3"
], ],
"PythonVersion": ">=3.10.4", "PythonVersion": ">=3.10.4",
"PythonPath": { "PythonPath": {},
"linux": ""
},
"Classifiers": [] "Classifiers": []
}, },
"BuildSettings": { "BuildSettings": {

View File

@ -20,4 +20,5 @@ class Application(ApplicationABC):
def main(self): def main(self):
Console.write_line("KDB Post-Build:") Console.write_line("KDB Post-Build:")
Console.spinner(f"Removing unnecessary configs", self._remove_config.remove) Console.spinner(f"Removing unnecessary configs", self._remove_config.remove)
Console.spinner(f"Creating requirements file for pip", self._deps.create) # Console.spinner(f"Creating requirements file for pip", self._deps.create)
self._deps.create()

View File

@ -1,15 +1,12 @@
import traceback
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
from cpl_core.console import Console
class PostBuildSettings(ConfigurationModelABC): class PostBuildSettings(ConfigurationModelABC):
def __init__(self): def __init__(self, keep_configs=None, config_paths=None):
ConfigurationModelABC.__init__(self) ConfigurationModelABC.__init__(self)
self._keep_config = [] self._keep_config = keep_configs if keep_configs is not None else []
self._config_paths = [] self._config_paths = config_paths if config_paths is not None else []
@property @property
def keep_config(self) -> list[str]: def keep_config(self) -> list[str]:
@ -18,11 +15,3 @@ class PostBuildSettings(ConfigurationModelABC):
@property @property
def config_paths(self) -> list[str]: def config_paths(self) -> list[str]:
return self._config_paths return self._config_paths
def from_dict(self, settings: dict):
try:
self._keep_config = settings["KeepConfigs"]
self._config_paths = settings["ConfigPaths"]
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()}")