Build version 2022.6.3
This commit is contained in:
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||
__version__ = '2022.6.3.dev6'
|
||||
__version__ = '2022.6.3'
|
||||
|
||||
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='3.dev6')
|
||||
version_info = VersionInfo(major='2022', minor='6', micro='3')
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
from collections.abc import Callable
|
||||
from typing import Union, Type, Optional
|
||||
|
||||
@@ -278,28 +279,35 @@ class Configuration(ConfigurationABC):
|
||||
for arg_name in ConfigurationVariableNameEnum.to_list():
|
||||
self.add_console_argument(VariableArgument('--', str(arg_name).upper(), [str(arg_name).lower()], '='))
|
||||
|
||||
arg_list = sys.argv[1:]
|
||||
executables: list[ExecutableArgument] = []
|
||||
self._parse_arguments(executables, arg_list, self._argument_types)
|
||||
try:
|
||||
arg_list = sys.argv[1:]
|
||||
executables: list[ExecutableArgument] = []
|
||||
self._parse_arguments(executables, arg_list, self._argument_types)
|
||||
except Exception as e:
|
||||
Console.error('An error occurred while parsing arguments.')
|
||||
exit()
|
||||
|
||||
prevent = False
|
||||
for exe in executables:
|
||||
if prevent:
|
||||
continue
|
||||
|
||||
if exe.validators is not None:
|
||||
abort = False
|
||||
for validator_type in exe.validators:
|
||||
validator: ValidatorABC = services.get_service(validator_type)
|
||||
result = validator.validate()
|
||||
abort = not result
|
||||
if abort:
|
||||
break
|
||||
|
||||
if abort:
|
||||
try:
|
||||
prevent = False
|
||||
for exe in executables:
|
||||
if prevent:
|
||||
continue
|
||||
|
||||
cmd: CommandABC = services.get_service(exe.executable_type)
|
||||
self.add_configuration('ACTIVE_EXECUTABLE', exe.name)
|
||||
cmd.execute(self._additional_arguments)
|
||||
prevent = exe.prevent_next_executable
|
||||
if exe.validators is not None:
|
||||
abort = False
|
||||
for validator_type in exe.validators:
|
||||
validator: ValidatorABC = services.get_service(validator_type)
|
||||
result = validator.validate()
|
||||
abort = not result
|
||||
if abort:
|
||||
break
|
||||
|
||||
if abort:
|
||||
continue
|
||||
|
||||
cmd: CommandABC = services.get_service(exe.executable_type)
|
||||
self.add_configuration('ACTIVE_EXECUTABLE', exe.name)
|
||||
cmd.execute(self._additional_arguments)
|
||||
prevent = exe.prevent_next_executable
|
||||
except Exception as e:
|
||||
Console.error('An error occurred while executing arguments.')
|
||||
|
Reference in New Issue
Block a user