Compare commits
10 Commits
cac80657df
...
2021.10.0
Author | SHA1 | Date | |
---|---|---|---|
6fa47f19af | |||
fb2872422e | |||
8460c0fa33 | |||
18f95341f4 | |||
a8011267d9 | |||
f8ebb4f1d7 | |||
3903f85368 | |||
05a9bdbf4a | |||
2809a9cd82 | |||
1c6794dc40 |
@@ -1,8 +1,8 @@
|
||||
upload:
|
||||
prod:
|
||||
cpl:
|
||||
twine upload --repository-url https://pip.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload -r pip.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload --repository-url https://pip.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
cli:
|
||||
twine upload --repository-url https://pip.sh-edraft.de dist/sh_cpl-cli/publish/setup/*
|
||||
twine upload -r pip.sh-edraft.de dist/sh_cpl-cli/publish/setup/*
|
||||
@@ -13,8 +13,8 @@ upload:
|
||||
|
||||
exp:
|
||||
cpl:
|
||||
twine upload --repository-url https://pip-exp.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload -r pip-exp.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload --repository-url https://pip-exp.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip-exp.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
|
||||
cli:
|
||||
twine upload --repository-url https://pip-exp.sh-edraft.de dist/sh_cpl-cli/publish/setup/*
|
||||
@@ -26,8 +26,8 @@ upload:
|
||||
|
||||
dev:
|
||||
cpl:
|
||||
twine upload --repository-url https://pip-dev.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload -r pip-dev.sh-edraft.de dist/sh_cpl/publish/setup/*
|
||||
twine upload --repository-url https://pip-dev.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip-dev.sh-edraft.de dist/sh_cpl-core/publish/setup/*
|
||||
|
||||
cli:
|
||||
twine upload --repository-url https://pip-dev.sh-edraft.de dist/sh_cpl-cli/publish/setup/*
|
||||
|
@@ -12,4 +12,4 @@ cpl publish
|
||||
|
||||
# CPL Query
|
||||
cd /home/sven/Nextcloud_Sven/Schreibtisch/git_sh-edraft_de/sh_cpl/src/cpl_query
|
||||
cpl
|
||||
cpl publish
|
16
scripts/upload.sh
Normal file
16
scripts/upload.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $1 == "-prod" ]; then
|
||||
twine upload -r pip.sh-edraft.de ../dist/sh_cpl-cli/publish/setup/*
|
||||
twine upload -r pip.sh-edraft.de ../dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip.sh-edraft.de ../dist/sh_cpl-query/publish/setup/*
|
||||
elif [ $1 == "-prod" ]; then
|
||||
twine upload -r pip-exp.sh-edraft.de ../dist/sh_cpl-cli/publish/setup/*
|
||||
twine upload -r pip-exp.sh-edraft.de ../dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip-.sh-edraft.de ../dist/sh_cpl-query/publish/setup/*
|
||||
|
||||
else
|
||||
twine upload -r pip-dev.sh-edraft.de ../dist/sh_cpl-cli/publish/setup/*
|
||||
twine upload -r pip-dev.sh-edraft.de ../dist/sh_cpl-core/publish/setup/*
|
||||
twine upload -r pip-dev.sh-edraft.de ../dist/sh_cpl-query/publish/setup/*
|
||||
fi
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -29,4 +29,4 @@ from .main import main
|
||||
from .startup import Startup
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.command'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -45,9 +45,14 @@ class VersionService(CommandABC):
|
||||
Console.write_line(f'OS: {platform.system()} {platform.processor()}')
|
||||
|
||||
Console.write_line('\nCPL packages:')
|
||||
cpl_packages = [
|
||||
'cpl_core',
|
||||
'cpl_cli',
|
||||
'cpl_query'
|
||||
]
|
||||
packages = []
|
||||
for importer, modname, is_pkg in pkgutil.iter_modules(cpl_core.__path__):
|
||||
module = importer.find_module(modname).load_module(modname)
|
||||
for modname in cpl_packages:
|
||||
module = pkgutil.find_loader(modname).load_module(modname)
|
||||
if '__version__' in dir(module):
|
||||
packages.append([f'{modname}', module.__version__])
|
||||
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.configuration'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "2021",
|
||||
"Minor": "10",
|
||||
"Micro": "5"
|
||||
"Micro": "0"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
@@ -16,7 +16,7 @@
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||
"Dependencies": [
|
||||
"sh_cpl>=2021.4.0.post1"
|
||||
"sh_cpl-core>=2021.10.0"
|
||||
],
|
||||
"PythonVersion": ">=3.8",
|
||||
"PythonPath": {},
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.publish'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.5'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='5')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -25,30 +25,25 @@ from cpl_cli.error import Error
|
||||
from cpl_cli.live_server.live_server_service import LiveServerService
|
||||
from cpl_cli.publish.publisher_service import PublisherService
|
||||
from cpl_cli.publish.publisher_abc import PublisherABC
|
||||
from cpl_core.environment import ApplicationEnvironment
|
||||
|
||||
|
||||
class Startup(StartupABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
|
||||
def __init__(self):
|
||||
StartupABC.__init__(self)
|
||||
|
||||
self._configuration = config
|
||||
self._env = self._configuration.environment
|
||||
self._services = services
|
||||
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||
environment.set_runtime_directory(os.path.dirname(__file__))
|
||||
configuration.argument_error_function = Error.error
|
||||
|
||||
self._env.set_runtime_directory(os.path.dirname(__file__))
|
||||
configuration.add_environment_variables('PYTHON_')
|
||||
configuration.add_environment_variables('CPL_')
|
||||
configuration.add_json_file('appsettings.json', path=environment.runtime_directory, optional=False, output=False)
|
||||
|
||||
def configure_configuration(self) -> ConfigurationABC:
|
||||
self._configuration.argument_error_function = Error.error
|
||||
|
||||
self._configuration.add_environment_variables('PYTHON_')
|
||||
self._configuration.add_environment_variables('CPL_')
|
||||
self._configuration.add_json_file('appsettings.json', path=self._env.runtime_directory,
|
||||
optional=False, output=False)
|
||||
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'add', ['a', 'a'], ' '))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'build', ['b', 'B'], ''))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'generate', ['g', 'G'], '', console_arguments=[
|
||||
configuration.add_console_argument(ConsoleArgument('', 'add', ['a', 'a'], ' '))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'build', ['b', 'B'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'generate', ['g', 'G'], '', console_arguments=[
|
||||
ConsoleArgument('', 'abc', ['a', 'A'], ' '),
|
||||
ConsoleArgument('', 'class', ['c', 'C'], ' '),
|
||||
ConsoleArgument('', 'enum', ['e', 'E'], ' '),
|
||||
@@ -56,54 +51,54 @@ class Startup(StartupABC):
|
||||
ConsoleArgument('', 'settings', ['st', 'ST'], ' '),
|
||||
ConsoleArgument('', 'thread', ['t', 't'], ' ')
|
||||
]))
|
||||
self._configuration.add_console_argument(
|
||||
configuration.add_console_argument(
|
||||
ConsoleArgument('', 'help', ['h', 'H'], ' ', is_value_token_optional=True)
|
||||
)
|
||||
self._configuration.add_console_argument(
|
||||
configuration.add_console_argument(
|
||||
ConsoleArgument('', 'install', ['i', 'I'], ' ', is_value_token_optional=True)
|
||||
)
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'new', ['n', 'N'], '', console_arguments=[
|
||||
configuration.add_console_argument(ConsoleArgument('', 'new', ['n', 'N'], '', console_arguments=[
|
||||
ConsoleArgument('', 'console', ['c', 'C'], ' '),
|
||||
ConsoleArgument('', 'library', ['l', 'L'], ' ')
|
||||
]))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'publish', ['p', 'P'], ''))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'remove', ['r', 'R'], ' '))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'start', ['s', 'S'], ''))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'uninstall', ['ui', 'UI'], ' '))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'update', ['u', 'U'], ''))
|
||||
self._configuration.add_console_argument(ConsoleArgument('', 'version', ['v', 'V'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'publish', ['p', 'P'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'remove', ['r', 'R'], ' '))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'start', ['s', 'S'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'uninstall', ['ui', 'UI'], ' '))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'update', ['u', 'U'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', 'version', ['v', 'V'], ''))
|
||||
|
||||
self._configuration.add_console_argument(ConsoleArgument('', '--help', ['-h', '-H'], ''))
|
||||
configuration.add_console_argument(ConsoleArgument('', '--help', ['-h', '-H'], ''))
|
||||
|
||||
if os.path.isfile(os.path.join(self._env.working_directory, 'cpl-workspace.json')):
|
||||
self._configuration.add_json_file('cpl-workspace.json', optional=True, output=False)
|
||||
workspace: Optional[WorkspaceSettings] = self._configuration.get_configuration(WorkspaceSettings)
|
||||
if os.path.isfile(os.path.join(environment.working_directory, 'cpl-workspace.json')):
|
||||
configuration.add_json_file('cpl-workspace.json', optional=True, output=False)
|
||||
workspace: Optional[WorkspaceSettings] = configuration.get_configuration(WorkspaceSettings)
|
||||
for script in workspace.scripts:
|
||||
self._configuration.add_console_argument(
|
||||
configuration.add_console_argument(
|
||||
ConsoleArgument('', script, [], ' ', is_value_token_optional=True))
|
||||
|
||||
self._configuration.add_console_arguments(error=False)
|
||||
configuration.add_console_arguments(error=False)
|
||||
|
||||
return self._configuration
|
||||
return configuration
|
||||
|
||||
def configure_services(self) -> ServiceProviderABC:
|
||||
self._services.add_singleton(CommandHandler)
|
||||
def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||
services.add_singleton(CommandHandler)
|
||||
|
||||
self._services.add_transient(PublisherABC, PublisherService)
|
||||
self._services.add_transient(LiveServerService)
|
||||
services.add_transient(PublisherABC, PublisherService)
|
||||
services.add_transient(LiveServerService)
|
||||
|
||||
self._services.add_transient(AddService)
|
||||
self._services.add_transient(BuildService)
|
||||
self._services.add_transient(CustomScriptService)
|
||||
self._services.add_transient(GenerateService)
|
||||
self._services.add_transient(HelpService)
|
||||
self._services.add_transient(InstallService)
|
||||
self._services.add_transient(NewService)
|
||||
self._services.add_transient(PublishService)
|
||||
self._services.add_transient(RemoveService)
|
||||
self._services.add_transient(StartService)
|
||||
self._services.add_transient(UninstallService)
|
||||
self._services.add_transient(UpdateService)
|
||||
self._services.add_transient(VersionService)
|
||||
services.add_transient(AddService)
|
||||
services.add_transient(BuildService)
|
||||
services.add_transient(CustomScriptService)
|
||||
services.add_transient(GenerateService)
|
||||
services.add_transient(HelpService)
|
||||
services.add_transient(InstallService)
|
||||
services.add_transient(NewService)
|
||||
services.add_transient(PublishService)
|
||||
services.add_transient(RemoveService)
|
||||
services.add_transient(StartService)
|
||||
services.add_transient(UninstallService)
|
||||
services.add_transient(UpdateService)
|
||||
services.add_transient(VersionService)
|
||||
|
||||
return self._services.build_service_provider()
|
||||
return services.build_service_provider()
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_core'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.application'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -26,4 +26,4 @@ from .application_builder_abc import ApplicationBuilderABC
|
||||
from .startup_abc import StartupABC
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -12,9 +12,9 @@ class ApplicationABC(ABC):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
Contains object loaded from appsettings
|
||||
services: :class:`cpl.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
services: :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Contains instances of prepared objects
|
||||
"""
|
||||
|
||||
@@ -39,7 +39,7 @@ class ApplicationABC(ABC):
|
||||
def configure(self):
|
||||
r"""Configure the application
|
||||
|
||||
Called by :class:`cpl.application.application_abc.ApplicationABC.run`
|
||||
Called by :class:`cpl_core.application.application_abc.ApplicationABC.run`
|
||||
"""
|
||||
pass
|
||||
|
||||
@@ -47,6 +47,6 @@ class ApplicationABC(ABC):
|
||||
def main(self):
|
||||
r"""Custom entry point
|
||||
|
||||
Called by :class:`cpl.application.application_abc.ApplicationABC.run`
|
||||
Called by :class:`cpl_core.application.application_abc.ApplicationABC.run`
|
||||
"""
|
||||
pass
|
||||
|
@@ -1,18 +1,21 @@
|
||||
from typing import Type, Optional
|
||||
import types
|
||||
from typing import Type, Optional, Callable
|
||||
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.application.application_builder_abc import ApplicationBuilderABC
|
||||
from cpl_core.application.application_extension_abc import ApplicationExtensionABC
|
||||
from cpl_core.application.startup_abc import StartupABC
|
||||
from cpl_core.configuration.configuration import Configuration
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection.service_collection import ServiceCollection
|
||||
|
||||
|
||||
class ApplicationBuilder(ApplicationBuilderABC):
|
||||
r"""This is class is used to build a object of :class:`cpl.application.application_abc.ApplicationABC`
|
||||
r"""This is class is used to build a object of :class:`cpl_core.application.application_abc.ApplicationABC`
|
||||
|
||||
Parameter
|
||||
---------
|
||||
app: Type[:class:`cpl.application.application_abc.ApplicationABC`]
|
||||
app: Type[:class:`cpl_core.application.application_abc.ApplicationABC`]
|
||||
Application to build
|
||||
"""
|
||||
|
||||
@@ -25,12 +28,25 @@ class ApplicationBuilder(ApplicationBuilderABC):
|
||||
self._environment = self._configuration.environment
|
||||
self._services = ServiceCollection(self._configuration)
|
||||
|
||||
self._extensions: list[Callable] = []
|
||||
|
||||
def use_startup(self, startup: Type[StartupABC]):
|
||||
self._startup = startup(self._configuration, self._services)
|
||||
self._startup = startup()
|
||||
|
||||
def use_extension(self, extension: Type[ApplicationExtensionABC]):
|
||||
if extension not in self._extensions:
|
||||
self._extensions.append(extension)
|
||||
|
||||
def build(self) -> ApplicationABC:
|
||||
if self._startup is not None:
|
||||
self._startup.configure_configuration()
|
||||
self._startup.configure_services()
|
||||
self._startup.configure_configuration(self._configuration, self._environment)
|
||||
self._startup.configure_services(self._services, self._environment)
|
||||
|
||||
return self._app(self._configuration, self._services.build_service_provider())
|
||||
config = self._configuration
|
||||
services = self._services.build_service_provider()
|
||||
|
||||
for ex in self._extensions:
|
||||
extension = ex()
|
||||
extension.run(config, services)
|
||||
|
||||
return self._app(config, services)
|
||||
|
@@ -6,7 +6,7 @@ from cpl_core.application.startup_abc import StartupABC
|
||||
|
||||
|
||||
class ApplicationBuilderABC(ABC):
|
||||
r"""ABC for the :class:`cpl.application.application_builder.ApplicationBuilder`"""
|
||||
r"""ABC for the :class:`cpl_core.application.application_builder.ApplicationBuilder`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, *args):
|
||||
@@ -18,7 +18,7 @@ class ApplicationBuilderABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
startup: Type[:class:`cpl.application.startup_abc.StartupABC`]
|
||||
startup: Type[:class:`cpl_core.application.startup_abc.StartupABC`]
|
||||
Startup class to use
|
||||
"""
|
||||
pass
|
||||
@@ -29,6 +29,6 @@ class ApplicationBuilderABC(ABC):
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of :class:`cpl.application.application_abc.ApplicationABC`
|
||||
Object of :class:`cpl_core.application.application_abc.ApplicationABC`
|
||||
"""
|
||||
pass
|
||||
|
13
src/cpl_core/application/application_extension_abc.py
Normal file
13
src/cpl_core/application/application_extension_abc.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class ApplicationExtensionABC(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def run(self, config: ConfigurationABC, services: ServiceProviderABC): pass
|
@@ -1,7 +1,9 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class StartupABC(ABC):
|
||||
@@ -12,21 +14,31 @@ class StartupABC(ABC):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def configure_configuration(self) -> ConfigurationABC:
|
||||
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC) -> ConfigurationABC:
|
||||
r"""Creates configuration of application
|
||||
|
||||
Parameter
|
||||
---------
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
||||
Object of :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def configure_services(self) -> ServiceProviderABC:
|
||||
def configure_services(self, service: ServiceCollectionABC, env: ApplicationEnvironmentABC) -> ServiceProviderABC:
|
||||
r"""Creates service provider
|
||||
|
||||
Parameter
|
||||
---------
|
||||
services: :class:`cpl_core.dependency_injection.service_collection_abc`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of :class:`cpl.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Object of :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
"""
|
||||
pass
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -27,4 +27,4 @@ from .configuration_variable_name_enum import ConfigurationVariableNameEnum
|
||||
from .console_argument import ConsoleArgument
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -122,7 +122,7 @@ class Configuration(ConfigurationABC):
|
||||
---------
|
||||
argument: :class:`str`
|
||||
Command as string
|
||||
argument_type: :class:`cpl.configuration.console_argument.ConsoleArgument`
|
||||
argument_type: :class:`cpl_core.configuration.console_argument.ConsoleArgument`
|
||||
Command type as ConsoleArgument
|
||||
next_arguments: list[:class:`str`]
|
||||
Following arguments of argument
|
||||
|
@@ -11,7 +11,7 @@ class ConfigurationABC(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
r"""ABC for the :class:`cpl.configuration.configuration.Configuration`"""
|
||||
r"""ABC for the :class:`cpl_core.configuration.configuration.Configuration`"""
|
||||
pass
|
||||
|
||||
@property
|
||||
@@ -47,7 +47,7 @@ class ConfigurationABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
argument: :class:`cpl.configuration.console_argument.ConsoleArgument`
|
||||
argument: :class:`cpl_core.configuration.console_argument.ConsoleArgument`
|
||||
Specifies the console argument
|
||||
"""
|
||||
pass
|
||||
@@ -88,7 +88,7 @@ class ConfigurationABC(ABC):
|
||||
---------
|
||||
key_type: Union[:class:`str`, :class:`type`]
|
||||
Type of the value
|
||||
value: Union[:class:`str`, :class:`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]
|
||||
value: Union[:class:`str`, :class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`]
|
||||
Object of the value
|
||||
"""
|
||||
pass
|
||||
@@ -99,11 +99,11 @@ class ConfigurationABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
search_type: Union[:class:`str`, Type[:class:`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]
|
||||
search_type: Union[:class:`str`, Type[:class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`]]
|
||||
Type to search for
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of Union[:class:`str`, Callable[:class:`cpl.configuration.configuration_model_abc.ConfigurationModelABC`]]
|
||||
Object of Union[:class:`str`, Callable[:class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`]]
|
||||
"""
|
||||
pass
|
||||
|
@@ -17,7 +17,7 @@ class ConsoleArgument:
|
||||
aliases: list[:class:`str`]
|
||||
value_token: :class:`str`
|
||||
is_value_token_optional: :class:`bool`
|
||||
console_arguments: List[:class:`cpl.configuration.console_argument.ConsoleArgument`]
|
||||
console_arguments: List[:class:`cpl_core.configuration.console_argument.ConsoleArgument`]
|
||||
"""
|
||||
self._token = token
|
||||
self._name = name
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.console'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -64,7 +64,7 @@ class Console:
|
||||
|
||||
Parameter
|
||||
---------
|
||||
color: Union[:class:`cpl.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
color: Union[:class:`cpl_core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
Background color of the console
|
||||
"""
|
||||
if type(color) is str:
|
||||
@@ -78,7 +78,7 @@ class Console:
|
||||
|
||||
Parameter
|
||||
---------
|
||||
color: Union[:class:`cpl.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
color: Union[:class:`cpl_core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
Foreground color of the console
|
||||
"""
|
||||
if type(color) is str:
|
||||
@@ -365,17 +365,17 @@ class Console:
|
||||
Message or header of the selection
|
||||
options: List[:class:`str`]
|
||||
Selectable options
|
||||
header_foreground_color: Union[:class:`str`, :class:`cpl.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
header_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the header
|
||||
header_background_color: Union[:class:`str`, :class:`cpl.console.background_color_enum.BackgroundColorEnum`]
|
||||
header_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the header
|
||||
option_foreground_color: Union[:class:`str`, :class:`cpl.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
option_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the options
|
||||
option_background_color: Union[:class:`str`, :class:`cpl.console.background_color_enum.BackgroundColorEnum`]
|
||||
option_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the options
|
||||
cursor_foreground_color: Union[:class:`str`, :class:`cpl.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
cursor_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the cursor
|
||||
cursor_background_color: Union[:class:`str`, :class:`cpl.console.background_color_enum.BackgroundColorEnum`]
|
||||
cursor_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the cursor
|
||||
|
||||
Returns
|
||||
@@ -423,13 +423,13 @@ class Console:
|
||||
Function to call
|
||||
args: :class:`list`
|
||||
Arguments of the function
|
||||
text_foreground_color: Union[:class:`str`, :class:`cpl.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
text_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the text
|
||||
spinner_foreground_color: Union[:class:`str`, :class:`cpl.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
spinner_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the spinner
|
||||
text_background_color: Union[:class:`str`, :class:`cpl.console.background_color_enum.BackgroundColorEnum`]
|
||||
text_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the text
|
||||
spinner_background_color: Union[:class:`str`, :class:`cpl.console.background_color_enum.BackgroundColorEnum`]
|
||||
spinner_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the spinner
|
||||
kwargs: :class:`dict`
|
||||
Keyword arguments of the call
|
||||
|
@@ -16,9 +16,9 @@ class SpinnerThread(threading.Thread):
|
||||
---------
|
||||
msg_len: :class:`int`
|
||||
Length of the message
|
||||
foreground_color: :class:`cpl.console.foreground_color.ForegroundColorEnum`
|
||||
foreground_color: :class:`cpl_core.console.foreground_color.ForegroundColorEnum`
|
||||
Foreground color of the spinner
|
||||
background_color: :class:`cpl.console.background_color.BackgroundColorEnum`
|
||||
background_color: :class:`cpl_core.console.background_color.BackgroundColorEnum`
|
||||
Background color of the spinner
|
||||
"""
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "2021",
|
||||
"Minor": "10",
|
||||
"Micro": "6"
|
||||
"Micro": "0"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.database'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings
|
||||
from .database_settings_name_enum import DatabaseSettingsNameEnum
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -14,7 +14,7 @@ class DatabaseConnection(DatabaseConnectionABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
database_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
||||
database_settings: :class:`cpl_core.database.database_settings.DatabaseSettings`
|
||||
"""
|
||||
|
||||
def __init__(self, database_settings: DatabaseSettings):
|
||||
|
@@ -5,7 +5,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
|
||||
class DatabaseConnectionABC(ABC):
|
||||
r"""ABC for the :class:`cpl.database.connection.database_connection.DatabaseConnection`"""
|
||||
r"""ABC for the :class:`cpl_core.database.connection.database_connection.DatabaseConnection`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ class DatabaseContext(DatabaseContextABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
database_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
||||
database_settings: :class:`cpl_core.database.database_settings.DatabaseSettings`
|
||||
"""
|
||||
|
||||
def __init__(self, database_settings: DatabaseSettings):
|
||||
|
@@ -5,7 +5,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
|
||||
class DatabaseContextABC(ABC):
|
||||
r"""ABC for the :class:`cpl.database.context.database_context.DatabaseContext`"""
|
||||
r"""ABC for the :class:`cpl_core.database.context.database_context.DatabaseContext`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, *args):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -28,4 +28,4 @@ from .service_provider import ServiceProvider
|
||||
from .service_provider_abc import ServiceProviderABC
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -8,7 +8,7 @@ from cpl_core.dependency_injection.service_provider_abc import ServiceProviderAB
|
||||
|
||||
|
||||
class ServiceCollectionABC(ABC):
|
||||
r"""ABC for the class :class:`cpl.dependency_injection.service_collection.ServiceCollection`"""
|
||||
r"""ABC for the class :class:`cpl_core.dependency_injection.service_collection.ServiceCollection`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -20,9 +20,9 @@ class ServiceCollectionABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
db_context: Type[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
||||
db_context: Type[:class:`cpl_core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
Database context
|
||||
db_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
||||
db_settings: :class:`cpl_core.database.database_settings.DatabaseSettings`
|
||||
Database settings
|
||||
"""
|
||||
pass
|
||||
@@ -77,6 +77,6 @@ class ServiceCollectionABC(ABC):
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of type :class:`cpl.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Object of type :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
"""
|
||||
pass
|
||||
|
@@ -10,7 +10,7 @@ class ServiceDescriptor:
|
||||
---------
|
||||
implementation: Union[:class:`type`, Optional[:class:`object`]]
|
||||
Object or type of service
|
||||
lifetime: :class:`cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||
lifetime: :class:`cpl_core.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||
Lifetime of the service
|
||||
"""
|
||||
|
||||
|
@@ -16,11 +16,11 @@ class ServiceProvider(ServiceProviderABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
service_descriptors: list[:class:`cpl.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||
service_descriptors: list[:class:`cpl_core.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||
Descriptor of the service
|
||||
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
CPL Configuration
|
||||
db_context: Optional[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
||||
db_context: Optional[:class:`cpl_core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
Database representation
|
||||
"""
|
||||
|
||||
|
@@ -4,7 +4,7 @@ from typing import Type, Optional
|
||||
|
||||
|
||||
class ServiceProviderABC(ABC):
|
||||
r"""ABC for the class :class:`cpl.dependency_injection.service_provider.ServiceProvider`"""
|
||||
r"""ABC for the class :class:`cpl_core.dependency_injection.service_provider.ServiceProvider`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -12,7 +12,7 @@ class ApplicationEnvironment(ApplicationEnvironmentABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
name: :class:`cpl.environment.environment_name_enum.EnvironmentNameEnum`
|
||||
name: :class:`cpl_core.environment.environment_name_enum.EnvironmentNameEnum`
|
||||
"""
|
||||
|
||||
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production):
|
||||
|
@@ -3,7 +3,7 @@ from datetime import datetime
|
||||
|
||||
|
||||
class ApplicationEnvironmentABC(ABC):
|
||||
r"""ABC of the class :class:`cpl.environment.application_environment.ApplicationEnvironment`"""
|
||||
r"""ABC of the class :class:`cpl_core.environment.application_environment.ApplicationEnvironment`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -2,7 +2,7 @@ from abc import abstractmethod, ABC
|
||||
|
||||
|
||||
class LoggerABC(ABC):
|
||||
r"""ABC for :class:`cpl.logging.logger_service.Logger`"""
|
||||
r"""ABC for :class:`cpl_core.logging.logger_service.Logger`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
|
@@ -17,11 +17,11 @@ class Logger(LoggerABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
logging_settings: :class:`cpl.logging.logging_settings.LoggingSettings`
|
||||
logging_settings: :class:`cpl_core.logging.logging_settings.LoggingSettings`
|
||||
Settings for the logger
|
||||
time_format: :class:`cpl.time.time_format_settings.TimeFormatSettings`
|
||||
time_format: :class:`cpl_core.time.time_format_settings.TimeFormatSettings`
|
||||
Time format settings
|
||||
env: :class:`cpl.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
env: :class:`cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
Environment of the application
|
||||
"""
|
||||
|
||||
@@ -116,7 +116,7 @@ class Logger(LoggerABC):
|
||||
---------
|
||||
name: :class:`str`
|
||||
Name of the message
|
||||
level: :class:`cpl.logging.logging_level_enum.LoggingLevelEnum`
|
||||
level: :class:`cpl_core.logging.logging_level_enum.LoggingLevelEnum`
|
||||
Logging level
|
||||
message: :class:`str`
|
||||
Log message
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -4,7 +4,7 @@ from cpl_core.mailing.email import EMail
|
||||
|
||||
|
||||
class EMailClientABC(ABC):
|
||||
"""ABC of :class:`cpl.mailing.email_client_service.EMailClient`"""
|
||||
"""ABC of :class:`cpl_core.mailing.email_client_service.EMailClient`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -21,7 +21,7 @@ class EMailClientABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
email: :class:`cpl.mailing.email.EMail`
|
||||
email: :class:`cpl_core.mailing.email.EMail`
|
||||
Object of the E-Mail to send
|
||||
"""
|
||||
pass
|
||||
|
@@ -15,11 +15,11 @@ class EMailClient(EMailClientABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
environment: :class:`cpl.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
environment: :class:`cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
Environment of the application
|
||||
logger: :class:`cpl.logging.logger_abc.LoggerABC`
|
||||
logger: :class:`cpl_core.logging.logger_abc.LoggerABC`
|
||||
The logger to use
|
||||
mail_settings: :class:`cpl.mailing.email_client_settings.EMailClientSettings`
|
||||
mail_settings: :class:`cpl_core.mailing.email_client_settings.EMailClientSettings`
|
||||
Settings for mailing
|
||||
"""
|
||||
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.time'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.6'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
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='2021', minor='10', micro='6')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_query'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.0rc1'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0.rc1')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_query._extension'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.0rc1'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0.rc1')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_query._query'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.0rc1'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0.rc1')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "2021",
|
||||
"Minor": "10",
|
||||
"Micro": "0.rc1"
|
||||
"Micro": "0"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
@@ -16,7 +16,7 @@
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||
"Dependencies": [
|
||||
"sh_cpl>=2021.4.0.post1"
|
||||
"sh_cpl-core>=2021.10.0"
|
||||
],
|
||||
"PythonVersion": ">=3.9.2",
|
||||
"PythonPath": {},
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_query.extension'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.0rc1'
|
||||
__version__ = '2021.10.0'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0.rc1')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='0')
|
||||
|
@@ -1,13 +1,12 @@
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl_core.logging.logger_abc import LoggerABC
|
||||
from cpl_core.mailing.email import EMail
|
||||
from cpl_core.mailing.email_client_abc import EMailClientABC
|
||||
from cpl_core.mailing import EMailClientABC, EMail
|
||||
from test_service import TestService
|
||||
|
||||
|
||||
@@ -37,7 +36,8 @@ class Application(ApplicationABC):
|
||||
self._mailer = self._services.get_service(EMailClientABC)
|
||||
|
||||
def main(self):
|
||||
self._logger.header(f'{self._configuration.environment.application_name}:')
|
||||
if self._configuration.environment.application_name != '':
|
||||
self._logger.header(f'{self._configuration.environment.application_name}:')
|
||||
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}')
|
||||
|
@@ -1,11 +1,13 @@
|
||||
from cpl_core.application.application_builder import ApplicationBuilder
|
||||
from application import Application
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
from general.test_extension import TestExtension
|
||||
from startup import Startup
|
||||
|
||||
|
||||
def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.use_startup(Startup)
|
||||
app_builder.use_extension(TestExtension)
|
||||
app_builder.build().run()
|
||||
|
||||
|
||||
|
@@ -2,6 +2,7 @@ from cpl_core.application.startup_abc import StartupABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.logging.logger_service import Logger
|
||||
from cpl_core.logging.logger_abc import LoggerABC
|
||||
from cpl_core.mailing.email_client_service import EMailClient
|
||||
@@ -11,24 +12,21 @@ from test_service import TestService
|
||||
|
||||
class Startup(StartupABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
|
||||
def __init__(self):
|
||||
StartupABC.__init__(self)
|
||||
|
||||
self._configuration = config
|
||||
self._services = services
|
||||
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC) -> ConfigurationABC:
|
||||
config.add_environment_variables('PYTHON_')
|
||||
config.add_environment_variables('CPL_')
|
||||
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)
|
||||
|
||||
def configure_configuration(self) -> ConfigurationABC:
|
||||
self._configuration.add_environment_variables('PYTHON_')
|
||||
self._configuration.add_environment_variables('CPL_')
|
||||
self._configuration.add_json_file(f'appsettings.json')
|
||||
self._configuration.add_json_file(f'appsettings.{self._configuration.environment.environment_name}.json')
|
||||
self._configuration.add_json_file(f'appsettings.{self._configuration.environment.host_name}.json', optional=True)
|
||||
return config
|
||||
|
||||
return self._configuration
|
||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC) -> ServiceProviderABC:
|
||||
services.add_singleton(LoggerABC, Logger)
|
||||
services.add_singleton(EMailClientABC, EMailClient)
|
||||
services.add_singleton(TestService)
|
||||
|
||||
def configure_services(self) -> ServiceProviderABC:
|
||||
self._services.add_singleton(LoggerABC, Logger)
|
||||
self._services.add_singleton(EMailClientABC, EMailClient)
|
||||
self._services.add_singleton(TestService)
|
||||
|
||||
return self._services.build_service_provider()
|
||||
return services.build_service_provider()
|
||||
|
13
src/tests/custom/general/src/general/test_extension.py
Normal file
13
src/tests/custom/general/src/general/test_extension.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from cpl_core.application.application_extension_abc import ApplicationExtensionABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class TestExtension(ApplicationExtensionABC):
|
||||
|
||||
def __init__(self):
|
||||
ApplicationExtensionABC.__init__(self)
|
||||
|
||||
def run(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
Console.write_line('Hello World from App Extension')
|
Reference in New Issue
Block a user