From a590cfd066a673555236eb547c9d27e91cafde65 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 24 May 2022 20:12:59 +0200 Subject: [PATCH] Bugfixes for start service --- src/cpl_cli/__init__.py | 4 ++-- src/cpl_cli/_templates/__init__.py | 4 ++-- src/cpl_cli/_templates/build/__init__.py | 4 ++-- src/cpl_cli/_templates/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- .../_templates/new/console/source/__init__.py | 4 ++-- .../new/console/source/name/__init__.py | 4 ++-- .../new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- .../_templates/new/library/source/__init__.py | 4 ++-- .../new/library/source/name/__init__.py | 4 ++-- .../new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl_cli.json | 4 ++-- src/cpl_cli/live_server/__init__.py | 4 ++-- src/cpl_cli/live_server/live_server_thread.py | 8 +++++--- src/cpl_cli/publish/__init__.py | 4 ++-- src/cpl_cli/source_creator/__init__.py | 4 ++-- src/cpl_cli/startup_argument_extension.py | 16 ++++++++++------ src/cpl_cli/validators/__init__.py | 4 ++-- src/cpl_cli/validators/project_validator.py | 18 +++++++++++++++--- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/configuration/configuration.py | 5 +++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/cpl_core.json | 2 +- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/cpl_query.json | 4 ++-- src/cpl_query/extension/__init__.py | 4 ++-- .../custom/general/src/general/application.py | 3 +++ .../custom/general/src/general/startup.py | 2 +- 46 files changed, 116 insertions(+), 94 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index dd9130b0..f3ca3736 100644 --- a/src/cpl_cli/__init__.py +++ b/src/cpl_cli/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_cli' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 16b7f27a..acffcedb 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 09d7467f..5279f4e4 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index a3cfab2b..ce3673a1 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 1a507cb6..ef172265 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index 3e5c078c..20764c00 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 904dab76..5614e4d3 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 0a57dd5c..a29b81ee 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 641845d0..59230eaf 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 6d25f13a..2cb1352e 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index 3311bfb0..9434e616 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 11080dcc..91f30c0b 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index 8e2ac7b3..f16b2616 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index 2f57860d..16d2f507 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 4e8582d7..bc697505 100644 --- a/src/cpl_cli/command/__init__.py +++ b/src/cpl_cli/command/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_cli.command' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -28,4 +28,4 @@ from .publish_service import PublishService from .version_service import VersionService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index 4ad35d94..dc79dcd4 100644 --- a/src/cpl_cli/configuration/__init__.py +++ b/src/cpl_cli/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_cli.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/cpl_cli.json b/src/cpl_cli/cpl_cli.json index 1ff7835d..5b11a4af 100644 --- a/src/cpl_cli/cpl_cli.json +++ b/src/cpl_cli/cpl_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "0.rc1" + "Micro": "1.dev2" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.0.rc1" + "cpl-core>=2022.6.1.dev2" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index a4eabf91..54a68f6f 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/live_server/live_server_thread.py b/src/cpl_cli/live_server/live_server_thread.py index 8824d2ee..efd1f988 100644 --- a/src/cpl_cli/live_server/live_server_thread.py +++ b/src/cpl_cli/live_server/live_server_thread.py @@ -60,7 +60,6 @@ class LiveServerThread(threading.Thread): Starts the CPL project :return: """ - Console.write_line(self._build_settings.main) main = self._build_settings.main if '.' in self._build_settings.main: length = len(self._build_settings.main.split('.')) - 1 @@ -89,7 +88,10 @@ class LiveServerThread(threading.Thread): Console.set_foreground_color(ForegroundColorEnum.default) self._command = [self._executable, self._main] - if len(self._args) > 0: - self._command.append(''.join(self._args)) + # if len(self._args) > 0: + # self._command.append(' '.join(self._args)) + for arg in self._args: + self._command.append(arg) + Console.write_line(self._command) subprocess.run(self._command, env=self._env_vars) diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 065d351d..ab11fb75 100644 --- a/src/cpl_cli/publish/__init__.py +++ b/src/cpl_cli/publish/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_cli.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index b5afcf24..79fe7928 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index 6ec1cd3a..bca0aa46 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -31,10 +31,10 @@ class StartupArgumentExtension(StartupExtensionABC): pass @staticmethod - def _search_project_json(env: ApplicationEnvironmentABC) -> Optional[str]: + def _search_project_json(working_directory: str) -> Optional[str]: project_name = None - name = os.path.basename(env.working_directory) - for r, d, f in os.walk(env.working_directory): + name = os.path.basename(working_directory) + for r, d, f in os.walk(working_directory): for file in f: if file.endswith('.json'): f_name = file.split('.json')[0] @@ -49,10 +49,14 @@ class StartupArgumentExtension(StartupExtensionABC): if workspace is not None: for script in workspace.scripts: config.create_console_argument(ArgumentTypeEnum.Executable, '', script, [], CustomScriptService) + return - project = workspace.projects[workspace.default_project] - else: - project = f'{self._search_project_json(env)}.json' + project = self._search_project_json(env.working_directory) + if project is not None: + project = f'{project}.json' + + if project is None: + return config.add_json_file(project, optional=True, output=False) diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 3314e33c..11111016 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_cli/validators/project_validator.py b/src/cpl_cli/validators/project_validator.py index 4f21d0e2..bfd0cf80 100644 --- a/src/cpl_cli/validators/project_validator.py +++ b/src/cpl_cli/validators/project_validator.py @@ -1,17 +1,29 @@ +import os + from cpl_cli import Error from cpl_cli.configuration import WorkspaceSettings, ProjectSettings +from cpl_core.configuration import ConfigurationABC from cpl_core.configuration.validator_abc import ValidatorABC +from cpl_core.environment import ApplicationEnvironmentABC class ProjectValidator(ValidatorABC): - def __init__(self, workspace: WorkspaceSettings, project: ProjectSettings): - self._workspace = workspace - self._project = project + def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC, workspace: WorkspaceSettings, project: ProjectSettings): + self._config: ConfigurationABC = config + self._env: ApplicationEnvironmentABC = env + self._workspace: WorkspaceSettings = workspace + self._project: ProjectSettings = project ValidatorABC.__init__(self) def validate(self) -> bool: + if self._project is None and self._workspace is not None: + project = self._workspace.projects[self._workspace.default_project] + self._config.add_json_file(project, optional=True, output=False) + self._project = self._config.get_configuration(ProjectSettings) + self._env.set_working_directory(os.path.join(self._env.working_directory, os.path.dirname(project))) + result = self._project is not None or self._workspace is not None if not result: Error.error('The command requires to be run in an CPL project, but a project could not be found.') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index c6641bef..8701d7b3 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 5d037a20..0f6fd1f5 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index c4028f6a..54b37ca6 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index 2b882fb0..748590e3 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -1,6 +1,7 @@ import json import os import sys +import traceback from collections.abc import Callable from typing import Union, Type, Optional @@ -304,7 +305,7 @@ class Configuration(ConfigurationABC): break if abort: - continue + sys.exit() cmd: ArgumentExecutableABC = services.get_service(exe.executable_type) self.add_configuration('ACTIVE_EXECUTABLE', exe.name) @@ -312,7 +313,7 @@ class Configuration(ConfigurationABC): prevent = exe.prevent_next_executable success = True except Exception as e: - Console.error('An error occurred while executing arguments.') + Console.error('An error occurred while executing arguments.', traceback.format_exc()) sys.exit() return success diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index fd894853..a099b04a 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/cpl_core.json b/src/cpl_core/cpl_core.json index d4f71278..cf40d12d 100644 --- a/src/cpl_core/cpl_core.json +++ b/src/cpl_core/cpl_core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "0.rc1" + "Micro": "1.dev2" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index f5ac69f3..7a47fd37 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index cb9e5717..6d846a21 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index cf5dd3b8..ba4fd73b 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index e79e12df..b5c83343 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index de305db6..551a3c11 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 8b5baa3a..66c76d41 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 26e7d1ec..5c942f2e 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index ddf90ee8..c180da44 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index 7d4bbaef..4aaace74 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 0a8515b5..2648dfa4 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index e97c2e51..eae682f3 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index 076ebaa0..6fd82c0e 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/cpl_query/cpl_query.json b/src/cpl_query/cpl_query.json index e2b3468e..c35e94b0 100644 --- a/src/cpl_query/cpl_query.json +++ b/src/cpl_query/cpl_query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "0.rc1" + "Micro": "1.dev2" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.0.rc1" + "cpl-core>=2022.6.1.dev2" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index 938ab636..4469bc70 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.0rc1' +__version__ = '2022.6.1.dev2' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='0.rc1') +version_info = VersionInfo(major='2022', minor='6', micro='1.dev2') diff --git a/src/tests/custom/general/src/general/application.py b/src/tests/custom/general/src/general/application.py index 648ef428..d83d569b 100644 --- a/src/tests/custom/general/src/general/application.py +++ b/src/tests/custom/general/src/general/application.py @@ -37,8 +37,11 @@ class Application(ApplicationABC): self._mailer = self._services.get_service(EMailClientABC) def main(self): + self._configuration.parse_console_arguments(self._services) + if self._configuration.environment.application_name != '': self._logger.header(f'{self._configuration.environment.application_name}:') + self._logger.debug(__name__, f'Args: {self._configuration.additional_arguments}') self._logger.debug(__name__, f'Host: {self._configuration.environment.host_name}') self._logger.debug(__name__, f'Environment: {self._configuration.environment.environment_name}') self._logger.debug(__name__, f'Customer: {self._configuration.environment.customer}') diff --git a/src/tests/custom/general/src/general/startup.py b/src/tests/custom/general/src/general/startup.py index 941dc1ef..e4b7d4f5 100644 --- a/src/tests/custom/general/src/general/startup.py +++ b/src/tests/custom/general/src/general/startup.py @@ -15,7 +15,7 @@ class Startup(StartupABC): def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC) -> ConfigurationABC: config.add_environment_variables('PYTHON_') - config.add_environment_variables('CPL_') + config.add_environment_variables('CPLT_') config.add_json_file(f'appsettings.json') config.add_json_file(f'appsettings.{config.environment.environment_name}.json') config.add_json_file(f'appsettings.{config.environment.host_name}.json', optional=True)