From 096b50f9f1a79fb010d0b878fec7f883ba5809df Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 14 Dec 2020 21:10:26 +0100 Subject: [PATCH 1/7] Added console module --- src/sh_edraft/configuration/configuration.py | 15 +++- .../connection/database_connection.py | 11 ++- .../database/context/database_context.py | 11 ++- .../database/model/database_settings.py | 9 ++- src/sh_edraft/logging/logger.py | 35 ++++++--- .../logging/model/logging_settings.py | 9 ++- .../model/publish_settings_model.py | 9 ++- .../time/model/time_format_settings.py | 7 +- src/sh_edraft/utils/console.py | 11 --- src/sh_edraft/utils/console/__init__.py | 3 + src/sh_edraft/utils/console/console.py | 76 +++++++++++++++++++ src/sh_edraft/utils/console/model/__init__.py | 4 + .../utils/console/model/background_color.py | 14 ++++ .../utils/console/model/foreground_color.py | 14 ++++ 14 files changed, 187 insertions(+), 41 deletions(-) delete mode 100644 src/sh_edraft/utils/console.py create mode 100644 src/sh_edraft/utils/console/__init__.py create mode 100644 src/sh_edraft/utils/console/console.py create mode 100644 src/sh_edraft/utils/console/model/__init__.py create mode 100644 src/sh_edraft/utils/console/model/background_color.py create mode 100644 src/sh_edraft/utils/console/model/foreground_color.py diff --git a/src/sh_edraft/configuration/configuration.py b/src/sh_edraft/configuration/configuration.py index f32148f0..6bc844d4 100644 --- a/src/sh_edraft/configuration/configuration.py +++ b/src/sh_edraft/configuration/configuration.py @@ -8,7 +8,8 @@ from sh_edraft.configuration.model.configuration_variable_name import Configurat from sh_edraft.environment.base.environment_base import EnvironmentBase from sh_edraft.environment.hosting_environment import HostingEnvironment from sh_edraft.environment.model.environment_name import EnvironmentName -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class Configuration(ConfigurationBase): @@ -25,15 +26,21 @@ class Configuration(ConfigurationBase): @staticmethod def _print_info(name: str, message: str): - Console.write_line(f'[{name}] {message}', 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(f'[{name}] {message}') + Console.set_foreground_color(ForegroundColor.default) @staticmethod def _print_warn(name: str, message: str): - Console.write_line(f'[{name}] {message}', 'yellow') + Console.set_foreground_color(ForegroundColor.yellow) + Console.write_line(f'[{name}] {message}') + Console.set_foreground_color(ForegroundColor.default) @staticmethod def _print_error(name: str, message: str): - Console.write_line(f'[{name}] {message}', 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(f'[{name}] {message}') + Console.set_foreground_color(ForegroundColor.default) def _set_variable(self, name: str, value: str): if name == ConfigurationVariableName.environment.value: diff --git a/src/sh_edraft/database/connection/database_connection.py b/src/sh_edraft/database/connection/database_connection.py index 9c50ae79..5878f2c0 100644 --- a/src/sh_edraft/database/connection/database_connection.py +++ b/src/sh_edraft/database/connection/database_connection.py @@ -5,7 +5,8 @@ from sqlalchemy.orm import Session, sessionmaker from sh_edraft.database.connection.base.database_connection_base import DatabaseConnectionBase from sh_edraft.database.model.database_settings import DatabaseSettings -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class DatabaseConnection(DatabaseConnectionBase): @@ -44,8 +45,12 @@ class DatabaseConnection(DatabaseConnectionBase): db_session = sessionmaker(bind=self._engine) self._session = db_session() - Console.write_line(f'[{__name__}] Connected to database', 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(f'[{__name__}] Connected to database') + Console.set_foreground_color(ForegroundColor.default) except Exception as e: - Console.write_line(f'[{__name__}] Database connection failed -> {e}', 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(f'[{__name__}] Database connection failed -> {e}') + Console.set_foreground_color(ForegroundColor.default) exit() diff --git a/src/sh_edraft/database/context/database_context.py b/src/sh_edraft/database/context/database_context.py index 07ba3719..0a3790ad 100644 --- a/src/sh_edraft/database/context/database_context.py +++ b/src/sh_edraft/database/context/database_context.py @@ -6,7 +6,8 @@ from sh_edraft.database.connection.base.database_connection_base import Database from sh_edraft.database.context.base.database_context_base import DatabaseContextBase from sh_edraft.database.model.dbmodel import DBModel from sh_edraft.database.model.database_settings import DatabaseSettings -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class DatabaseContext(DatabaseContextBase): @@ -39,7 +40,11 @@ class DatabaseContext(DatabaseContextBase): DBModel.metadata.drop_all(self._db.engine, self._tables) DBModel.metadata.create_all(self._db.engine, self._tables, checkfirst=True) - Console.write_line(f'[{__name__}] Created tables', 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(f'[{__name__}] Created tables') + Console.set_foreground_color(ForegroundColor.default) except Exception as e: - Console.write_line(f'[{__name__}] Creating tables failed -> {e}', 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(f'[{__name__}] Creating tables failed -> {e}') + Console.set_foreground_color(ForegroundColor.default) exit() diff --git a/src/sh_edraft/database/model/database_settings.py b/src/sh_edraft/database/model/database_settings.py index a8df384d..da3dc590 100644 --- a/src/sh_edraft/database/model/database_settings.py +++ b/src/sh_edraft/database/model/database_settings.py @@ -3,7 +3,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.database.model.database_settings_name import DatabaseSettingsName -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class DatabaseSettings(ConfigurationModelBase): @@ -71,5 +72,7 @@ class DatabaseSettings(ConfigurationModelBase): if DatabaseSettingsName.echo.value in settings: self._echo = bool(settings[DatabaseSettingsName.echo.value]) except Exception as e: - Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings', 'red') - Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}', 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') + Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') + Console.set_foreground_color(ForegroundColor.default) diff --git a/src/sh_edraft/logging/logger.py b/src/sh_edraft/logging/logger.py index a043b21b..21e91c01 100644 --- a/src/sh_edraft/logging/logger.py +++ b/src/sh_edraft/logging/logger.py @@ -8,7 +8,8 @@ from sh_edraft.logging.base.logger_base import LoggerBase from sh_edraft.logging.model.logging_settings import LoggingSettings from sh_edraft.logging.model.logging_level import LoggingLevel from sh_edraft.time.model.time_format_settings import TimeFormatSettings -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class Logger(LoggerBase): @@ -80,7 +81,9 @@ class Logger(LoggerBase): def header(self, string: str): # append log and print message self._append_log(string) - Console.write_line(string, 'white') + Console.set_foreground_color(ForegroundColor.default) + Console.write_line(string) + Console.set_foreground_color(ForegroundColor.default) def trace(self, name: str, message: str): output = self._get_string(name, LoggingLevel.TRACE, message) @@ -91,7 +94,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.TRACE.value: - Console.write_line(output, 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) def debug(self, name: str, message: str): output = self._get_string(name, LoggingLevel.DEBUG, message) @@ -102,7 +107,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.DEBUG.value: - Console.write_line(output, 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) def info(self, name: str, message: str): output = self._get_string(name, LoggingLevel.INFO, message) @@ -113,7 +120,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.INFO.value: - Console.write_line(output, 'green') + Console.set_foreground_color(ForegroundColor.green) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) def warn(self, name: str, message: str): output = self._get_string(name, LoggingLevel.WARN, message) @@ -124,7 +133,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.WARN.value: - Console.write_line(output, 'yellow') + Console.set_foreground_color(ForegroundColor.yellow) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) def error(self, name: str, message: str, ex: Exception = None): output = '' @@ -141,7 +152,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.ERROR.value: - Console.write_line(output, 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) def fatal(self, name: str, message: str, ex: Exception = None): output = '' @@ -158,7 +171,9 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.FATAL.value: - Console.write_line(output, 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) exit() @@ -173,6 +188,8 @@ class Logger(LoggerBase): # check if message can be shown in console if self._console.value >= LoggingLevel.FATAL.value: - Console.write_line(output, 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(output) + Console.set_foreground_color(ForegroundColor.default) exit() diff --git a/src/sh_edraft/logging/model/logging_settings.py b/src/sh_edraft/logging/model/logging_settings.py index 47889dea..b884f944 100644 --- a/src/sh_edraft/logging/model/logging_settings.py +++ b/src/sh_edraft/logging/model/logging_settings.py @@ -3,8 +3,9 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.logging.model.logging_settings_name import LoggingSettingsName -from sh_edraft.utils.console import Console from sh_edraft.logging.model.logging_level import LoggingLevel +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class LoggingSettings(ConfigurationModelBase): @@ -55,5 +56,7 @@ class LoggingSettings(ConfigurationModelBase): self._console = LoggingLevel[settings[LoggingSettingsName.console_level.value]] self._level = LoggingLevel[settings[LoggingSettingsName.file_level.value]] except Exception as e: - Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings', 'red') - Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}', 'red') + Console.set_foreground_color(ForegroundColor.red) + Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') + Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') + Console.set_foreground_color(ForegroundColor.default) diff --git a/src/sh_edraft/publishing/model/publish_settings_model.py b/src/sh_edraft/publishing/model/publish_settings_model.py index a743692a..3b9ed148 100644 --- a/src/sh_edraft/publishing/model/publish_settings_model.py +++ b/src/sh_edraft/publishing/model/publish_settings_model.py @@ -4,7 +4,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.publishing.model.template import Template from sh_edraft.publishing.model.publish_settings_name import PublishSettingsName -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class PublishSettings(ConfigurationModelBase): @@ -78,6 +79,8 @@ class PublishSettings(ConfigurationModelBase): self._excluded_files = settings[PublishSettingsName.excluded_files.value] self._template_ending = settings[PublishSettingsName.template_ending.value] except Exception as e: + Console.set_foreground_color(ForegroundColor.red) Console.write_line( - f'[ ERROR ] [ {__name__} ]: Reading error in {PublishSettingsName.publish.value} settings', 'red') - Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}', 'red') + f'[ ERROR ] [ {__name__} ]: Reading error in {PublishSettingsName.publish.value} settings') + Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') + Console.set_foreground_color(ForegroundColor.default) diff --git a/src/sh_edraft/time/model/time_format_settings.py b/src/sh_edraft/time/model/time_format_settings.py index 64508ef2..55366710 100644 --- a/src/sh_edraft/time/model/time_format_settings.py +++ b/src/sh_edraft/time/model/time_format_settings.py @@ -3,7 +3,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.time.model.time_format_settings_names import TimeFormatSettingsNames -from sh_edraft.utils.console import Console +from sh_edraft.utils.console.console import Console +from sh_edraft.utils.console.model.foreground_color import ForegroundColor class TimeFormatSettings(ConfigurationModelBase): @@ -56,5 +57,7 @@ class TimeFormatSettings(ConfigurationModelBase): self._date_time_format = settings[TimeFormatSettingsNames.date_time_format.value] self._date_time_log_format = settings[TimeFormatSettingsNames.date_time_log_format.value] except Exception as e: + Console.set_foreground_color(ForegroundColor.red) Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') - Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}', 'red') + Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') + Console.set_foreground_color(ForegroundColor.default) diff --git a/src/sh_edraft/utils/console.py b/src/sh_edraft/utils/console.py deleted file mode 100644 index 1d014a9c..00000000 --- a/src/sh_edraft/utils/console.py +++ /dev/null @@ -1,11 +0,0 @@ -from termcolor import colored - - -class Console: - - @staticmethod - def write_line(string: str, color: str = None): - if color is not None: - print(colored(string, color)) - else: - print(string) diff --git a/src/sh_edraft/utils/console/__init__.py b/src/sh_edraft/utils/console/__init__.py new file mode 100644 index 00000000..161a350e --- /dev/null +++ b/src/sh_edraft/utils/console/__init__.py @@ -0,0 +1,3 @@ +# imports: + +from .console import Console diff --git a/src/sh_edraft/utils/console/console.py b/src/sh_edraft/utils/console/console.py new file mode 100644 index 00000000..f4b13254 --- /dev/null +++ b/src/sh_edraft/utils/console/console.py @@ -0,0 +1,76 @@ +import os +import subprocess +from typing import Union +from termcolor import colored + +from sh_edraft.utils.console.model.background_color import BackgroundColor +from sh_edraft.utils.console.model.foreground_color import ForegroundColor + + +class Console: + _background_color: BackgroundColor = BackgroundColor.default + _foreground_color: ForegroundColor = ForegroundColor.default + + @property + def background_color(self) -> BackgroundColor: + return self._background_color + + @property + def foreground_color(self) -> ForegroundColor: + return self._foreground_color + + @classmethod + def set_background_color(cls, color: Union[BackgroundColor, str]): + if type(color) is str: + cls._background_color = BackgroundColor[color] + else: + cls._background_color = color + + @classmethod + def set_foreground_color(cls, color: Union[ForegroundColor, str]): + if type(color) is str: + cls._foreground_color = ForegroundColor[color] + else: + cls._foreground_color = color + + # useful methods + @staticmethod + def clear(): + os.system('cls' if os.name == 'nt' else 'clear') + + @staticmethod + def new(): + if os.name == 'nt': + os.system("start /wait cmd") + else: + p = subprocess.Popen(args=["gnome-terminal"]) + p.communicate() + + @staticmethod + def read(output: str = None) -> str: + user_input = input(output if output else '') + return user_input[0] + + @staticmethod + def read_line(output: str = None) -> str: + return input(output if output else '') + + @classmethod + def reset(cls): + cls._background_color = BackgroundColor.default + cls._foreground_color = ForegroundColor.default + + @classmethod + def write(cls, string: str): + if cls._foreground_color == ForegroundColor.default: + print(colored(string), end='') + else: + print(colored(string, cls._foreground_color.value), end='') + + @classmethod + def write_line(cls, *args): + string = ' '.join(map(str, args)) + if cls._foreground_color == ForegroundColor.default: + print(colored(string)) + else: + print(colored(string, cls._foreground_color.value)) diff --git a/src/sh_edraft/utils/console/model/__init__.py b/src/sh_edraft/utils/console/model/__init__.py new file mode 100644 index 00000000..c5051d39 --- /dev/null +++ b/src/sh_edraft/utils/console/model/__init__.py @@ -0,0 +1,4 @@ +# imports: + +from .background_color import BackgroundColor +from .foreground_color import ForegroundColor diff --git a/src/sh_edraft/utils/console/model/background_color.py b/src/sh_edraft/utils/console/model/background_color.py new file mode 100644 index 00000000..a50f49c8 --- /dev/null +++ b/src/sh_edraft/utils/console/model/background_color.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class BackgroundColor(Enum): + + default = 'default' + grey = 'grey' + red = 'red' + green = 'green' + yellow = 'yellow' + blue = 'blue' + magenta = 'magenta' + cyan = 'cyan' + white = 'white' diff --git a/src/sh_edraft/utils/console/model/foreground_color.py b/src/sh_edraft/utils/console/model/foreground_color.py new file mode 100644 index 00000000..463d4ae7 --- /dev/null +++ b/src/sh_edraft/utils/console/model/foreground_color.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class ForegroundColor(Enum): + + default = 'default' + grey = 'grey' + red = 'red' + green = 'green' + yellow = 'yellow' + blue = 'blue' + magenta = 'magenta' + cyan = 'cyan' + white = 'white' From 7473b8deaba3378993156fde542a588d71d3b922 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 14:03:31 +0100 Subject: [PATCH 2/7] Improved console --- src/sh_edraft/hosting/application_host.py | 4 + src/sh_edraft/utils/console/console.py | 101 ++++++++++++++---- .../utils/console/model/background_color.py | 18 ++-- src/tests_dev/program.py | 18 +++- 4 files changed, 108 insertions(+), 33 deletions(-) diff --git a/src/sh_edraft/hosting/application_host.py b/src/sh_edraft/hosting/application_host.py index fa4b2182..339916c6 100644 --- a/src/sh_edraft/hosting/application_host.py +++ b/src/sh_edraft/hosting/application_host.py @@ -1,3 +1,4 @@ +import atexit from datetime import datetime from sh_edraft.configuration.configuration import Configuration @@ -7,6 +8,7 @@ from sh_edraft.hosting.application_runtime import ApplicationRuntime from sh_edraft.hosting.base.application_host_base import ApplicationHostBase from sh_edraft.service.providing.service_provider import ServiceProvider from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase +from sh_edraft.utils.console import Console class ApplicationHost(ApplicationHostBase): @@ -27,6 +29,8 @@ class ApplicationHost(ApplicationHostBase): self._start_time: datetime = datetime.now() self._end_time: datetime = datetime.now() + atexit.register(Console.close) + @property def configuration(self) -> ConfigurationBase: return self._config diff --git a/src/sh_edraft/utils/console/console.py b/src/sh_edraft/utils/console/console.py index f4b13254..deb7bc50 100644 --- a/src/sh_edraft/utils/console/console.py +++ b/src/sh_edraft/utils/console/console.py @@ -1,6 +1,8 @@ +import contextlib +import io import os -import subprocess -from typing import Union +import sys +from typing import Union, Optional from termcolor import colored from sh_edraft.utils.console.model.background_color import BackgroundColor @@ -10,14 +12,26 @@ from sh_edraft.utils.console.model.foreground_color import ForegroundColor class Console: _background_color: BackgroundColor = BackgroundColor.default _foreground_color: ForegroundColor = ForegroundColor.default + _x: Optional[int] = None + _y: Optional[int] = None - @property - def background_color(self) -> BackgroundColor: - return self._background_color + """ + Properties + """ + @classmethod @property - def foreground_color(self) -> ForegroundColor: - return self._foreground_color + def background_color(cls) -> str: + return str(cls._background_color.value) + + @classmethod + @property + def foreground_color(cls) -> str: + return str(cls._foreground_color.value) + + """ + Settings + """ @classmethod def set_background_color(cls, color: Union[BackgroundColor, str]): @@ -33,18 +47,54 @@ class Console: else: cls._foreground_color = color - # useful methods + @classmethod + def reset_cursor_position(cls): + cls._x = None + cls._y = None + + @classmethod + def set_cursor_position(cls, x: int, y: int): + cls._x = x + cls._y = y + + """ + Useful protected methods + """ + + @classmethod + def _output(cls, string: str, x: int = None, y: int = None, end='\n'): + args = [] + colored_args = [] + + if x is not None and y is not None: + args.append(f'\033[{x};{y}H') + elif cls._x is not None and cls._y is not None: + args.append(f'\033[{cls._x};{cls._y}H') + + colored_args.append(string) + if cls._foreground_color != ForegroundColor.default and cls._background_color == BackgroundColor.default: + colored_args.append(cls._foreground_color.value) + elif cls._foreground_color == ForegroundColor.default and cls._background_color != BackgroundColor.default: + colored_args.append(cls._background_color.value) + elif cls._foreground_color != ForegroundColor.default and cls._background_color != BackgroundColor.default: + colored_args.append(cls._foreground_color.value) + colored_args.append(cls._background_color.value) + + args.append(colored(*colored_args)) + print(*args, end=end) + + """ + Useful public methods + """ + @staticmethod def clear(): os.system('cls' if os.name == 'nt' else 'clear') @staticmethod - def new(): - if os.name == 'nt': - os.system("start /wait cmd") - else: - p = subprocess.Popen(args=["gnome-terminal"]) - p.communicate() + def close(): + Console.read_line('\nPress any key to continue...') + exit() @staticmethod def read(output: str = None) -> str: @@ -61,16 +111,21 @@ class Console: cls._foreground_color = ForegroundColor.default @classmethod - def write(cls, string: str): - if cls._foreground_color == ForegroundColor.default: - print(colored(string), end='') - else: - print(colored(string, cls._foreground_color.value), end='') + def write(cls, *args): + string = ' '.join(map(str, args)) + cls._output(string, end='') + + @classmethod + def write_at(cls, x: int, y: int, *args): + string = ' '.join(map(str, args)) + cls._output(string, x, y) @classmethod def write_line(cls, *args): string = ' '.join(map(str, args)) - if cls._foreground_color == ForegroundColor.default: - print(colored(string)) - else: - print(colored(string, cls._foreground_color.value)) + cls._output(string) + + @classmethod + def write_line_at(cls, x: int, y: int, *args): + string = ' '.join(map(str, args)) + cls._output(string, x, y) diff --git a/src/sh_edraft/utils/console/model/background_color.py b/src/sh_edraft/utils/console/model/background_color.py index a50f49c8..f4947e30 100644 --- a/src/sh_edraft/utils/console/model/background_color.py +++ b/src/sh_edraft/utils/console/model/background_color.py @@ -3,12 +3,12 @@ from enum import Enum class BackgroundColor(Enum): - default = 'default' - grey = 'grey' - red = 'red' - green = 'green' - yellow = 'yellow' - blue = 'blue' - magenta = 'magenta' - cyan = 'cyan' - white = 'white' + default = 'on_default' + grey = 'on_grey' + red = 'on_red' + green = 'on_green' + yellow = 'on_yellow' + blue = 'on_blue' + magenta = 'on_magenta' + cyan = 'on_cyan' + white = 'on_white' diff --git a/src/tests_dev/program.py b/src/tests_dev/program.py index baf29064..c9d1574a 100644 --- a/src/tests_dev/program.py +++ b/src/tests_dev/program.py @@ -8,7 +8,7 @@ from sh_edraft.hosting.base import ApplicationBase from sh_edraft.logging import Logger from sh_edraft.logging.base import LoggerBase from sh_edraft.service.providing.base import ServiceProviderBase -from sh_edraft.utils import CredentialManager +from sh_edraft.utils import CredentialManager, Console from tests_dev.db.user_repo import UserRepo from tests_dev.db.user_repo_base import UserRepoBase @@ -56,3 +56,19 @@ class Program(ApplicationBase): self._logger.debug(__name__, f'Environment: {self._configuration.environment.environment_name}') self._logger.debug(__name__, f'Customer: {self._configuration.environment.customer}') self._services.get_service(UserRepoBase).add_test_user() + + Console.clear() + Console.write_line('Hello', 'World') + # name = Console.read_line('Name: ') + # Console.write_line('Hello', name) + Console.set_foreground_color('red') + Console.set_background_color('green') + Console.set_cursor_position(5, 5) + Console.write_line('Error') + Console.write_line_at(10, 10, 'Error') + Console.reset_cursor_position() + Console.set_foreground_color('green') + Console.set_background_color('default') + Console.write('Test') + Console.write_line('1') + Console.write_line(Console.foreground_color) From 78c4b6ef0967d5d510a11f464cf162b01fc963c7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 16:53:15 +0100 Subject: [PATCH 3/7] Improved console --- src/sh_edraft/configuration/configuration.py | 4 +- src/sh_edraft/{utils => }/console/__init__.py | 0 src/sh_edraft/{utils => }/console/console.py | 38 +++++++++++-------- .../{utils => }/console/model/__init__.py | 0 .../console/model/background_color.py | 0 .../console/model/foreground_color.py | 0 .../connection/database_connection.py | 4 +- .../database/context/database_context.py | 4 +- .../database/model/database_settings.py | 4 +- src/sh_edraft/hosting/application_host.py | 2 +- src/sh_edraft/logging/logger.py | 4 +- .../logging/model/logging_settings.py | 4 +- .../model/publish_settings_model.py | 4 +- .../time/model/time_format_settings.py | 4 +- src/sh_edraft/utils/__init__.py | 1 - src/tests_dev/program.py | 12 ++++-- 16 files changed, 47 insertions(+), 38 deletions(-) rename src/sh_edraft/{utils => }/console/__init__.py (100%) rename src/sh_edraft/{utils => }/console/console.py (81%) rename src/sh_edraft/{utils => }/console/model/__init__.py (100%) rename src/sh_edraft/{utils => }/console/model/background_color.py (100%) rename src/sh_edraft/{utils => }/console/model/foreground_color.py (100%) diff --git a/src/sh_edraft/configuration/configuration.py b/src/sh_edraft/configuration/configuration.py index 6bc844d4..f4007ada 100644 --- a/src/sh_edraft/configuration/configuration.py +++ b/src/sh_edraft/configuration/configuration.py @@ -8,8 +8,8 @@ from sh_edraft.configuration.model.configuration_variable_name import Configurat from sh_edraft.environment.base.environment_base import EnvironmentBase from sh_edraft.environment.hosting_environment import HostingEnvironment from sh_edraft.environment.model.environment_name import EnvironmentName -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model import ForegroundColor class Configuration(ConfigurationBase): diff --git a/src/sh_edraft/utils/console/__init__.py b/src/sh_edraft/console/__init__.py similarity index 100% rename from src/sh_edraft/utils/console/__init__.py rename to src/sh_edraft/console/__init__.py diff --git a/src/sh_edraft/utils/console/console.py b/src/sh_edraft/console/console.py similarity index 81% rename from src/sh_edraft/utils/console/console.py rename to src/sh_edraft/console/console.py index deb7bc50..fb4612d9 100644 --- a/src/sh_edraft/utils/console/console.py +++ b/src/sh_edraft/console/console.py @@ -1,12 +1,9 @@ -import contextlib -import io import os -import sys from typing import Union, Optional from termcolor import colored -from sh_edraft.utils.console.model.background_color import BackgroundColor -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.model.background_color import BackgroundColor +from sh_edraft.console.model.foreground_color import ForegroundColor class Console: @@ -93,17 +90,24 @@ class Console: @staticmethod def close(): - Console.read_line('\nPress any key to continue...') + Console.reset() + Console.write('\n\n\nPress any key to continue...') + Console.read_line() exit() - @staticmethod - def read(output: str = None) -> str: - user_input = input(output if output else '') - return user_input[0] + @classmethod + def read(cls, output: str = None) -> str: + if output is not None: + cls.write(output) - @staticmethod - def read_line(output: str = None) -> str: - return input(output if output else '') + return input()[0] + + @classmethod + def read_line(cls, output: str = None) -> str: + if output is not None: + cls.write(output) + + return input() @classmethod def reset(cls): @@ -118,14 +122,16 @@ class Console: @classmethod def write_at(cls, x: int, y: int, *args): string = ' '.join(map(str, args)) - cls._output(string, x, y) + cls._output(string, x, y, end='') @classmethod def write_line(cls, *args): string = ' '.join(map(str, args)) - cls._output(string) + cls._output('') + cls._output(string, end='') @classmethod def write_line_at(cls, x: int, y: int, *args): string = ' '.join(map(str, args)) - cls._output(string, x, y) + cls._output('', end='') + cls._output(string, x, y, end='') diff --git a/src/sh_edraft/utils/console/model/__init__.py b/src/sh_edraft/console/model/__init__.py similarity index 100% rename from src/sh_edraft/utils/console/model/__init__.py rename to src/sh_edraft/console/model/__init__.py diff --git a/src/sh_edraft/utils/console/model/background_color.py b/src/sh_edraft/console/model/background_color.py similarity index 100% rename from src/sh_edraft/utils/console/model/background_color.py rename to src/sh_edraft/console/model/background_color.py diff --git a/src/sh_edraft/utils/console/model/foreground_color.py b/src/sh_edraft/console/model/foreground_color.py similarity index 100% rename from src/sh_edraft/utils/console/model/foreground_color.py rename to src/sh_edraft/console/model/foreground_color.py diff --git a/src/sh_edraft/database/connection/database_connection.py b/src/sh_edraft/database/connection/database_connection.py index 5878f2c0..b3397113 100644 --- a/src/sh_edraft/database/connection/database_connection.py +++ b/src/sh_edraft/database/connection/database_connection.py @@ -5,8 +5,8 @@ from sqlalchemy.orm import Session, sessionmaker from sh_edraft.database.connection.base.database_connection_base import DatabaseConnectionBase from sh_edraft.database.model.database_settings import DatabaseSettings -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class DatabaseConnection(DatabaseConnectionBase): diff --git a/src/sh_edraft/database/context/database_context.py b/src/sh_edraft/database/context/database_context.py index 0a3790ad..436ed53e 100644 --- a/src/sh_edraft/database/context/database_context.py +++ b/src/sh_edraft/database/context/database_context.py @@ -6,8 +6,8 @@ from sh_edraft.database.connection.base.database_connection_base import Database from sh_edraft.database.context.base.database_context_base import DatabaseContextBase from sh_edraft.database.model.dbmodel import DBModel from sh_edraft.database.model.database_settings import DatabaseSettings -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class DatabaseContext(DatabaseContextBase): diff --git a/src/sh_edraft/database/model/database_settings.py b/src/sh_edraft/database/model/database_settings.py index da3dc590..aed39e5f 100644 --- a/src/sh_edraft/database/model/database_settings.py +++ b/src/sh_edraft/database/model/database_settings.py @@ -3,8 +3,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.database.model.database_settings_name import DatabaseSettingsName -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class DatabaseSettings(ConfigurationModelBase): diff --git a/src/sh_edraft/hosting/application_host.py b/src/sh_edraft/hosting/application_host.py index 339916c6..9709c2c1 100644 --- a/src/sh_edraft/hosting/application_host.py +++ b/src/sh_edraft/hosting/application_host.py @@ -8,7 +8,7 @@ from sh_edraft.hosting.application_runtime import ApplicationRuntime from sh_edraft.hosting.base.application_host_base import ApplicationHostBase from sh_edraft.service.providing.service_provider import ServiceProvider from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase -from sh_edraft.utils.console import Console +from sh_edraft.console import Console class ApplicationHost(ApplicationHostBase): diff --git a/src/sh_edraft/logging/logger.py b/src/sh_edraft/logging/logger.py index 21e91c01..ec96469e 100644 --- a/src/sh_edraft/logging/logger.py +++ b/src/sh_edraft/logging/logger.py @@ -8,8 +8,8 @@ from sh_edraft.logging.base.logger_base import LoggerBase from sh_edraft.logging.model.logging_settings import LoggingSettings from sh_edraft.logging.model.logging_level import LoggingLevel from sh_edraft.time.model.time_format_settings import TimeFormatSettings -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class Logger(LoggerBase): diff --git a/src/sh_edraft/logging/model/logging_settings.py b/src/sh_edraft/logging/model/logging_settings.py index b884f944..563369cc 100644 --- a/src/sh_edraft/logging/model/logging_settings.py +++ b/src/sh_edraft/logging/model/logging_settings.py @@ -4,8 +4,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.logging.model.logging_settings_name import LoggingSettingsName from sh_edraft.logging.model.logging_level import LoggingLevel -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class LoggingSettings(ConfigurationModelBase): diff --git a/src/sh_edraft/publishing/model/publish_settings_model.py b/src/sh_edraft/publishing/model/publish_settings_model.py index 3b9ed148..4111d7fc 100644 --- a/src/sh_edraft/publishing/model/publish_settings_model.py +++ b/src/sh_edraft/publishing/model/publish_settings_model.py @@ -4,8 +4,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.publishing.model.template import Template from sh_edraft.publishing.model.publish_settings_name import PublishSettingsName -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class PublishSettings(ConfigurationModelBase): diff --git a/src/sh_edraft/time/model/time_format_settings.py b/src/sh_edraft/time/model/time_format_settings.py index 55366710..664192a4 100644 --- a/src/sh_edraft/time/model/time_format_settings.py +++ b/src/sh_edraft/time/model/time_format_settings.py @@ -3,8 +3,8 @@ from typing import Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.time.model.time_format_settings_names import TimeFormatSettingsNames -from sh_edraft.utils.console.console import Console -from sh_edraft.utils.console.model.foreground_color import ForegroundColor +from sh_edraft.console.console import Console +from sh_edraft.console.model.foreground_color import ForegroundColor class TimeFormatSettings(ConfigurationModelBase): diff --git a/src/sh_edraft/utils/__init__.py b/src/sh_edraft/utils/__init__.py index 10d2e9e5..db025911 100644 --- a/src/sh_edraft/utils/__init__.py +++ b/src/sh_edraft/utils/__init__.py @@ -20,7 +20,6 @@ __version__ = '2020.12.5' from collections import namedtuple # imports: -from .console import Console from .credential_manager import CredentialManager VersionInfo = namedtuple('VersionInfo', 'major minor micro') diff --git a/src/tests_dev/program.py b/src/tests_dev/program.py index c9d1574a..391a44ef 100644 --- a/src/tests_dev/program.py +++ b/src/tests_dev/program.py @@ -1,6 +1,7 @@ from typing import Optional from sh_edraft.configuration.base import ConfigurationBase +from sh_edraft.console import Console from sh_edraft.database.context import DatabaseContext from sh_edraft.database.model import DatabaseSettings from sh_edraft.hosting import ApplicationHost @@ -8,7 +9,7 @@ from sh_edraft.hosting.base import ApplicationBase from sh_edraft.logging import Logger from sh_edraft.logging.base import LoggerBase from sh_edraft.service.providing.base import ServiceProviderBase -from sh_edraft.utils import CredentialManager, Console +from sh_edraft.utils import CredentialManager from tests_dev.db.user_repo import UserRepo from tests_dev.db.user_repo_base import UserRepoBase @@ -65,10 +66,13 @@ class Program(ApplicationBase): Console.set_background_color('green') Console.set_cursor_position(5, 5) Console.write_line('Error') - Console.write_line_at(10, 10, 'Error') + Console.write_line_at(10, 5, 'Error') + Console.write_at(15, 5, 'Error') Console.reset_cursor_position() Console.set_foreground_color('green') Console.set_background_color('default') - Console.write('Test') - Console.write_line('1') + Console.write_line('Test') + Console.write('1') + # Console.write('x: ') + # Console.read_line('Test> ') Console.write_line(Console.foreground_color) From b6cbafbd0dddf4a686c73a647fc0461f0eee2b69 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 16:54:15 +0100 Subject: [PATCH 4/7] Improved ApplicationHost --- src/sh_edraft/hosting/application_host.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sh_edraft/hosting/application_host.py b/src/sh_edraft/hosting/application_host.py index 9709c2c1..1c5ed011 100644 --- a/src/sh_edraft/hosting/application_host.py +++ b/src/sh_edraft/hosting/application_host.py @@ -8,7 +8,7 @@ from sh_edraft.hosting.application_runtime import ApplicationRuntime from sh_edraft.hosting.base.application_host_base import ApplicationHostBase from sh_edraft.service.providing.service_provider import ServiceProvider from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase -from sh_edraft.console import Console +from sh_edraft.console.console import Console class ApplicationHost(ApplicationHostBase): From 6f82bd8b357ab44d4fbb65312444d57fba1647b0 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 17:09:04 +0100 Subject: [PATCH 5/7] Improved publisher --- .../model/publish_settings_model.py | 2 +- src/tests_dev/appsettings.development.json | 1 + src/tests_dev/appsettings.edrafts-pc.json | 57 +++++++++++++++++ src/tests_dev/publisher.py | 62 +++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 src/tests_dev/appsettings.edrafts-pc.json create mode 100644 src/tests_dev/publisher.py diff --git a/src/sh_edraft/publishing/model/publish_settings_model.py b/src/sh_edraft/publishing/model/publish_settings_model.py index 4111d7fc..9412be5b 100644 --- a/src/sh_edraft/publishing/model/publish_settings_model.py +++ b/src/sh_edraft/publishing/model/publish_settings_model.py @@ -74,7 +74,7 @@ class PublishSettings(ConfigurationModelBase): try: self._source_path = settings[PublishSettingsName.source_path.value] self._dist_path = settings[PublishSettingsName.dist_path.value] - self._templates = settings[PublishSettingsName.templates.value] + self._templates = Template().from_dict(settings[PublishSettingsName.templates.value]) self._included_files = settings[PublishSettingsName.included_files.value] self._excluded_files = settings[PublishSettingsName.excluded_files.value] self._template_ending = settings[PublishSettingsName.template_ending.value] diff --git a/src/tests_dev/appsettings.development.json b/src/tests_dev/appsettings.development.json index 3a54f3cc..d134912e 100644 --- a/src/tests_dev/appsettings.development.json +++ b/src/tests_dev/appsettings.development.json @@ -5,6 +5,7 @@ "ConsoleLogLevel": "TRACE", "FileLogLevel": "TRACE" }, + "DatabaseSettings": { "ConnectionString": "mysql+mysqlconnector://sh_cpl:$credentials@localhost/sh_cpl", "Credentials": "MHZhc0Y2bjhKc1VUMWV0Qw==", diff --git a/src/tests_dev/appsettings.edrafts-pc.json b/src/tests_dev/appsettings.edrafts-pc.json new file mode 100644 index 00000000..e73add9f --- /dev/null +++ b/src/tests_dev/appsettings.edrafts-pc.json @@ -0,0 +1,57 @@ +{ + "TimeFormatSettings": { + "DateFormat": "%Y-%m-%d", + "TimeFormat": "%H:%M:%S", + "DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f", + "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" + }, + "LoggingSettings": { + "Path": "logs/", + "Filename": "log_$start_time.log", + "ConsoleLogLevel": "TRACE", + "FileLogLevel": "TRACE" + }, + "PublisherSettings": { + "SourcePath": "../", + "DistPath": "../../dist", + "Templates": [ + { + "TemplatePath": "../../publish_templates/all_template.txt", + "Name": "all", + "Description": "", + "LongDescription": "", + "CopyrightDate": "2020", + "CopyrightName": "sh-edraft.de", + "LicenseName": "MIT", + "LicenseDescription": ", see LICENSE for more details.", + "Title": "", + "Author": "Sven Heidemann", + "Version": { + "major": 2020, + "minor": 12, + "micro": 9 + } + }, + { + "TemplatePath": "../../publish_templates/all_template.txt", + "Name": "sh_edraft", + "Description": "common python library", + "LongDescription": "Library to share common classes and models used at sh-edraft.de", + "CopyrightDate": "2020", + "CopyrightName": "sh-edraft.de", + "LicenseName": "MIT", + "LicenseDescription": ", see LICENSE for more details.", + "Title": "", + "Author": "Sven Heidemann", + "Version": { + "major": 2020, + "minor": 12, + "micro": 9 + } + } + ], + "IncludedFiles": [], + "ExcludedFiles": [], + "TemplateEnding": "_template.txt" + } +} \ No newline at end of file diff --git a/src/tests_dev/publisher.py b/src/tests_dev/publisher.py new file mode 100644 index 00000000..842e1d86 --- /dev/null +++ b/src/tests_dev/publisher.py @@ -0,0 +1,62 @@ +from typing import Optional + +from sh_edraft.configuration.base import ConfigurationBase +from sh_edraft.hosting import ApplicationHost +from sh_edraft.hosting.base import ApplicationBase +from sh_edraft.logging import Logger +from sh_edraft.logging.base import LoggerBase +from sh_edraft.publishing import Publisher +from sh_edraft.publishing.base import PublisherBase +from sh_edraft.service.providing.base import ServiceProviderBase + + +class Program(ApplicationBase): + + def __init__(self): + ApplicationBase.__init__(self) + + self._app_host: Optional[ApplicationHost] = None + self._services: Optional[ServiceProviderBase] = None + self._configuration: Optional[ConfigurationBase] = None + self._logger: Optional[LoggerBase] = None + self._publisher: Optional[PublisherBase] = None + + def create_application_host(self): + self._app_host = ApplicationHost() + self._configuration = self._app_host.configuration + self._services = self._app_host.services + + def create_configuration(self): + self._configuration.add_environment_variables('PYTHON_') + self._configuration.add_environment_variables('CPL_') + self._configuration.add_argument_variables() + 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) + + def create_services(self): + # Add and create logger + self._services.add_singleton(LoggerBase, Logger) + self._logger = self._services.get_service(LoggerBase) + + # Add and create publisher + self._services.add_singleton(PublisherBase, Publisher) + self._publisher: Publisher = self._services.get_service(PublisherBase) + + def main(self): + 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}') + #self._publisher.exclude() + #self._publisher.include() + # self._publisher.create() + print(self._publisher) + + +if __name__ == '__main__': + program = Program() + program.create_application_host() + program.create_configuration() + program.create_services() + program.main() From 7ee2eff483a6bc515d483282bb5f899be998f725 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 17:27:52 +0100 Subject: [PATCH 6/7] Improved publisher --- src/sh_edraft/coding/model/version_enum.py | 6 +++--- src/sh_edraft/console/console.py | 12 ++++++++++++ .../publishing/model/publish_settings_model.py | 12 ++++++++---- src/sh_edraft/publishing/model/template.py | 5 ++--- src/tests/services/publishing/publisher.py | 2 +- src/tests_dev/appsettings.edrafts-pc.json | 14 +++++++------- src/tests_dev/publisher.py | 11 ++++++++--- 7 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/sh_edraft/coding/model/version_enum.py b/src/sh_edraft/coding/model/version_enum.py index 446b6e16..8c294c1e 100644 --- a/src/sh_edraft/coding/model/version_enum.py +++ b/src/sh_edraft/coding/model/version_enum.py @@ -3,6 +3,6 @@ from enum import Enum class VersionEnum(Enum): - Major = 'major' - Minor = 'minor' - Micro = 'micro' + Major = 'Major' + Minor = 'Minor' + Micro = 'Micro' diff --git a/src/sh_edraft/console/console.py b/src/sh_edraft/console/console.py index fb4612d9..2418cf8a 100644 --- a/src/sh_edraft/console/console.py +++ b/src/sh_edraft/console/console.py @@ -11,6 +11,7 @@ class Console: _foreground_color: ForegroundColor = ForegroundColor.default _x: Optional[int] = None _y: Optional[int] = None + _disabled: bool = False """ Properties @@ -60,6 +61,9 @@ class Console: @classmethod def _output(cls, string: str, x: int = None, y: int = None, end='\n'): + if cls._disabled: + return + args = [] colored_args = [] @@ -95,6 +99,14 @@ class Console: Console.read_line() exit() + @classmethod + def disable(cls): + cls._disabled = True + + @classmethod + def enable(cls): + cls._disabled = False + @classmethod def read(cls, output: str = None) -> str: if output is not None: diff --git a/src/sh_edraft/publishing/model/publish_settings_model.py b/src/sh_edraft/publishing/model/publish_settings_model.py index 9412be5b..17b6b83c 100644 --- a/src/sh_edraft/publishing/model/publish_settings_model.py +++ b/src/sh_edraft/publishing/model/publish_settings_model.py @@ -15,10 +15,10 @@ class PublishSettings(ConfigurationModelBase): self._source_path: Optional[str] = None self._dist_path: Optional[str] = None - self._templates: Optional[list[Template]] = None + self._templates: list[Template] = [] - self._included_files: Optional[list[str]] = None - self._excluded_files: Optional[list[str]] = None + self._included_files: list[str] = [] + self._excluded_files: list[str] = [] self._template_ending: Optional[str] = None @@ -74,7 +74,11 @@ class PublishSettings(ConfigurationModelBase): try: self._source_path = settings[PublishSettingsName.source_path.value] self._dist_path = settings[PublishSettingsName.dist_path.value] - self._templates = Template().from_dict(settings[PublishSettingsName.templates.value]) + for template in settings[PublishSettingsName.templates.value]: + temp = Template() + temp.from_dict(template) + self._templates.append(temp) + self._included_files = settings[PublishSettingsName.included_files.value] self._excluded_files = settings[PublishSettingsName.excluded_files.value] self._template_ending = settings[PublishSettingsName.template_ending.value] diff --git a/src/sh_edraft/publishing/model/template.py b/src/sh_edraft/publishing/model/template.py index 91ba29e3..cea0f09c 100644 --- a/src/sh_edraft/publishing/model/template.py +++ b/src/sh_edraft/publishing/model/template.py @@ -19,7 +19,7 @@ class Template(ConfigurationModelBase): license_description: Optional[str] = None, title: Optional[str] = None, author: Optional[str] = None, - version: Optional[dict] = None + version: Optional[Version] = Version() ): ConfigurationModelBase.__init__(self) self._template_path: Optional[str] = template_path @@ -33,8 +33,7 @@ class Template(ConfigurationModelBase): self._title: Optional[str] = title self._author: Optional[str] = author - self._version: Optional[Version] = Version() - self._version.from_dict(version) + self._version: Optional[Version] = version self._file_content: Optional[str] = None diff --git a/src/tests/services/publishing/publisher.py b/src/tests/services/publishing/publisher.py index afb17eaa..9b75d13a 100644 --- a/src/tests/services/publishing/publisher.py +++ b/src/tests/services/publishing/publisher.py @@ -15,7 +15,7 @@ from sh_edraft.time.model import TimeFormatSettings class PublisherTest(unittest.TestCase): def _configure(self): - self._version = Version(2020, 12, 5).to_dict() + self._version = Version(2020, 12, 5) templates = [ Template( '../../publish_templates/all_template.txt', diff --git a/src/tests_dev/appsettings.edrafts-pc.json b/src/tests_dev/appsettings.edrafts-pc.json index e73add9f..3fb75c62 100644 --- a/src/tests_dev/appsettings.edrafts-pc.json +++ b/src/tests_dev/appsettings.edrafts-pc.json @@ -11,7 +11,7 @@ "ConsoleLogLevel": "TRACE", "FileLogLevel": "TRACE" }, - "PublisherSettings": { + "PublishSettings": { "SourcePath": "../", "DistPath": "../../dist", "Templates": [ @@ -27,9 +27,9 @@ "Title": "", "Author": "Sven Heidemann", "Version": { - "major": 2020, - "minor": 12, - "micro": 9 + "Major": 2020, + "Minor": 12, + "Micro": 9 } }, { @@ -44,9 +44,9 @@ "Title": "", "Author": "Sven Heidemann", "Version": { - "major": 2020, - "minor": 12, - "micro": 9 + "Major": 2020, + "Minor": 12, + "Micro": 9 } } ], diff --git a/src/tests_dev/publisher.py b/src/tests_dev/publisher.py index 842e1d86..78b8ddf4 100644 --- a/src/tests_dev/publisher.py +++ b/src/tests_dev/publisher.py @@ -1,6 +1,7 @@ from typing import Optional from sh_edraft.configuration.base import ConfigurationBase +from sh_edraft.console import Console from sh_edraft.hosting import ApplicationHost from sh_edraft.hosting.base import ApplicationBase from sh_edraft.logging import Logger @@ -20,6 +21,7 @@ class Program(ApplicationBase): self._configuration: Optional[ConfigurationBase] = None self._logger: Optional[LoggerBase] = None self._publisher: Optional[PublisherBase] = None + # Console.disable() def create_application_host(self): self._app_host = ApplicationHost() @@ -36,6 +38,7 @@ class Program(ApplicationBase): def create_services(self): # Add and create logger + Console.enable() self._services.add_singleton(LoggerBase, Logger) self._logger = self._services.get_service(LoggerBase) @@ -48,10 +51,12 @@ class Program(ApplicationBase): 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}') - #self._publisher.exclude() - #self._publisher.include() + self._publisher.exclude('../tests') + self._publisher.exclude('../tests_dev') + # self._publisher.include() # self._publisher.create() - print(self._publisher) + self._publisher.create() + self._publisher.publish() if __name__ == '__main__': From e9722271fb158148b59a9ca17818acb51ea2d09d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Dec 2020 17:29:32 +0100 Subject: [PATCH 7/7] Published for 2020.12.9 --- src/sh_edraft/__init__.py | 4 +-- src/sh_edraft/coding/__init__.py | 6 ++--- src/sh_edraft/coding/model/__init__.py | 8 +++--- src/sh_edraft/configuration/__init__.py | 4 +-- src/sh_edraft/configuration/base/__init__.py | 6 ++--- src/sh_edraft/configuration/model/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/console/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/console/model/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/database/__init__.py | 24 ++++++++++++++++++ src/sh_edraft/database/connection/__init__.py | 25 ++++++++++++++++++- .../database/connection/base/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/database/context/__init__.py | 25 ++++++++++++++++++- .../database/context/base/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/database/model/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/discord/__init__.py | 4 +-- src/sh_edraft/environment/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/environment/base/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/environment/model/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/hosting/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/hosting/base/__init__.py | 24 ++++++++++++++++++ src/sh_edraft/hosting/model/__init__.py | 24 ++++++++++++++++++ src/sh_edraft/logging/__init__.py | 4 +-- src/sh_edraft/logging/base/__init__.py | 4 +-- src/sh_edraft/logging/model/__init__.py | 8 +++--- src/sh_edraft/mailing/__init__.py | 4 +-- src/sh_edraft/messaging/__init__.py | 6 ++--- src/sh_edraft/publishing/__init__.py | 6 ++--- src/sh_edraft/publishing/base/__init__.py | 6 ++--- src/sh_edraft/publishing/model/__init__.py | 8 +++--- src/sh_edraft/service/__init__.py | 8 +++--- src/sh_edraft/service/base/__init__.py | 8 +++--- src/sh_edraft/service/model/__init__.py | 8 +++--- src/sh_edraft/service/providing/__init__.py | 25 ++++++++++++++++++- .../service/providing/base/__init__.py | 25 ++++++++++++++++++- .../service/providing/model/__init__.py | 25 ++++++++++++++++++- src/sh_edraft/time/__init__.py | 4 +-- src/sh_edraft/time/model/__init__.py | 8 +++--- src/sh_edraft/utils/__init__.py | 4 +-- src/tests/__init__.py | 4 +-- src/tests/configuration/__init__.py | 25 +++++++++++++++++++ src/tests/hosting/__init__.py | 25 +++++++++++++++++++ src/tests/service_providing/__init__.py | 25 +++++++++++++++++++ src/tests/services/__init__.py | 25 +++++++++++++++++++ src/tests/services/logging/__init__.py | 25 +++++++++++++++++++ src/tests/services/publishing/__init__.py | 25 +++++++++++++++++++ src/tests_dev/__init__.py | 25 +++++++++++++++++++ src/tests_dev/db/__init__.py | 25 +++++++++++++++++++ src/tests_dev/publisher.py | 4 --- 48 files changed, 693 insertions(+), 80 deletions(-) diff --git a/src/sh_edraft/__init__.py b/src/sh_edraft/__init__.py index 775e3790..a74b7597 100644 --- a/src/sh_edraft/__init__.py +++ b/src/sh_edraft/__init__.py @@ -15,11 +15,11 @@ __title__ = 'sh_edraft' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/coding/__init__.py b/src/sh_edraft/coding/__init__.py index 375dc28f..74fd8f6b 100644 --- a/src/sh_edraft/coding/__init__.py +++ b/src/sh_edraft/coding/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.coding +sh_edraft.coding ~~~~~~~~~~~~~~~~~~~ @@ -15,11 +15,11 @@ __title__ = 'sh_edraft.coding' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/coding/model/__init__.py b/src/sh_edraft/coding/model/__init__.py index 32344b00..ccdd0f5a 100644 --- a/src/sh_edraft/coding/model/__init__.py +++ b/src/sh_edraft/coding/model/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.coding.base +sh_edraft.coding.model ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.coding.base """ -__title__ = 'sh_edraft.coding.base' +__title__ = 'sh_edraft.coding.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -24,4 +24,4 @@ from .version import Version from .version_enum import VersionEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/configuration/__init__.py b/src/sh_edraft/configuration/__init__.py index 0aaef2f3..21979d7f 100644 --- a/src/sh_edraft/configuration/__init__.py +++ b/src/sh_edraft/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .configuration import Configuration VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/configuration/base/__init__.py b/src/sh_edraft/configuration/base/__init__.py index a9585439..28444895 100644 --- a/src/sh_edraft/configuration/base/__init__.py +++ b/src/sh_edraft/configuration/base/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.configuration.base +sh_edraft.configuration.base ~~~~~~~~~~~~~~~~~~~ @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.configuration.base' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -24,4 +24,4 @@ from .configuration_base import ConfigurationBase from .configuration_model_base import ConfigurationModelBase VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/configuration/model/__init__.py b/src/sh_edraft/configuration/model/__init__.py index a3c9f248..ae7cc417 100644 --- a/src/sh_edraft/configuration/model/__init__.py +++ b/src/sh_edraft/configuration/model/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.configuration.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.configuration.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .configuration_variable_name import ConfigurationVariableName + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/console/__init__.py b/src/sh_edraft/console/__init__.py index 161a350e..632019e8 100644 --- a/src/sh_edraft/console/__init__.py +++ b/src/sh_edraft/console/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.console +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.console' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .console import Console + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/console/model/__init__.py b/src/sh_edraft/console/model/__init__.py index c5051d39..3df50dae 100644 --- a/src/sh_edraft/console/model/__init__.py +++ b/src/sh_edraft/console/model/__init__.py @@ -1,4 +1,27 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.console.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.console.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .background_color import BackgroundColor from .foreground_color import ForegroundColor + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/__init__.py b/src/sh_edraft/database/__init__.py index 52f86f25..7bb526a4 100644 --- a/src/sh_edraft/database/__init__.py +++ b/src/sh_edraft/database/__init__.py @@ -1 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +sh_edraft.database +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + # imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/connection/__init__.py b/src/sh_edraft/database/connection/__init__.py index eae4c82d..5f3406df 100644 --- a/src/sh_edraft/database/connection/__init__.py +++ b/src/sh_edraft/database/connection/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.database.connection +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database.connection' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .database_connection import DatabaseConnection + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/connection/base/__init__.py b/src/sh_edraft/database/connection/base/__init__.py index 876327c9..492da1d6 100644 --- a/src/sh_edraft/database/connection/base/__init__.py +++ b/src/sh_edraft/database/connection/base/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.database.connection.base +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database.connection.base' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .database_connection_base import DatabaseConnectionBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/context/__init__.py b/src/sh_edraft/database/context/__init__.py index 0e46ede4..1f5bc196 100644 --- a/src/sh_edraft/database/context/__init__.py +++ b/src/sh_edraft/database/context/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.database.context +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database.context' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .database_context import DatabaseContext + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/context/base/__init__.py b/src/sh_edraft/database/context/base/__init__.py index ad5b61fb..63d9bb64 100644 --- a/src/sh_edraft/database/context/base/__init__.py +++ b/src/sh_edraft/database/context/base/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.database.context.base +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database.context.base' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .database_context_base import DatabaseContextBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/database/model/__init__.py b/src/sh_edraft/database/model/__init__.py index b51f2dca..de87e001 100644 --- a/src/sh_edraft/database/model/__init__.py +++ b/src/sh_edraft/database/model/__init__.py @@ -1,5 +1,28 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.database.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.database.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .database_settings import DatabaseSettings from .database_settings_name import DatabaseSettingsName from .dbmodel import DBModel + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/discord/__init__.py b/src/sh_edraft/discord/__init__.py index e1ab9453..6e3c9e4c 100644 --- a/src/sh_edraft/discord/__init__.py +++ b/src/sh_edraft/discord/__init__.py @@ -15,11 +15,11 @@ __title__ = 'sh_edraft.discord' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/environment/__init__.py b/src/sh_edraft/environment/__init__.py index 28c021f3..ac993870 100644 --- a/src/sh_edraft/environment/__init__.py +++ b/src/sh_edraft/environment/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.environment +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.environment' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .hosting_environment import HostingEnvironment + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/environment/base/__init__.py b/src/sh_edraft/environment/base/__init__.py index fec6499d..36b8b351 100644 --- a/src/sh_edraft/environment/base/__init__.py +++ b/src/sh_edraft/environment/base/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.environment.base +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.environment.base' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .environment_base import EnvironmentBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/environment/model/__init__.py b/src/sh_edraft/environment/model/__init__.py index 3204981f..59266f74 100644 --- a/src/sh_edraft/environment/model/__init__.py +++ b/src/sh_edraft/environment/model/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.environment.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.environment.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .environment_name import EnvironmentName + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/hosting/__init__.py b/src/sh_edraft/hosting/__init__.py index ec999843..d650f7e0 100644 --- a/src/sh_edraft/hosting/__init__.py +++ b/src/sh_edraft/hosting/__init__.py @@ -1,4 +1,27 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.hosting +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.hosting' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .application_host import ApplicationHost from .application_runtime import ApplicationRuntime + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/hosting/base/__init__.py b/src/sh_edraft/hosting/base/__init__.py index dfb25a31..47f46211 100644 --- a/src/sh_edraft/hosting/base/__init__.py +++ b/src/sh_edraft/hosting/base/__init__.py @@ -1,4 +1,28 @@ +# -*- coding: utf-8 -*- + +""" +sh_edraft.hosting.base +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.hosting.base' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + # imports: from .application_base import ApplicationBase from .application_host_base import ApplicationHostBase from .application_runtime_base import ApplicationRuntimeBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/hosting/model/__init__.py b/src/sh_edraft/hosting/model/__init__.py index 52f86f25..2ff0878e 100644 --- a/src/sh_edraft/hosting/model/__init__.py +++ b/src/sh_edraft/hosting/model/__init__.py @@ -1 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +sh_edraft.hosting.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.hosting.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + # imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/logging/__init__.py b/src/sh_edraft/logging/__init__.py index a70129f6..80fdec21 100644 --- a/src/sh_edraft/logging/__init__.py +++ b/src/sh_edraft/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .logger import Logger VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/logging/base/__init__.py b/src/sh_edraft/logging/base/__init__.py index 209ee125..83da99e0 100644 --- a/src/sh_edraft/logging/base/__init__.py +++ b/src/sh_edraft/logging/base/__init__.py @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.logging.base' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .logger_base import LoggerBase VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/logging/model/__init__.py b/src/sh_edraft/logging/model/__init__.py index 8c8ce494..e7bcd608 100644 --- a/src/sh_edraft/logging/model/__init__.py +++ b/src/sh_edraft/logging/model/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.logging.base +sh_edraft.logging.model ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.logging.base """ -__title__ = 'sh_edraft.logging.base' +__title__ = 'sh_edraft.logging.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -25,4 +25,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name import LoggingSettingsName VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/mailing/__init__.py b/src/sh_edraft/mailing/__init__.py index 5f2d9f23..4d478fe1 100644 --- a/src/sh_edraft/mailing/__init__.py +++ b/src/sh_edraft/mailing/__init__.py @@ -15,11 +15,11 @@ __title__ = 'sh_edraft.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/messaging/__init__.py b/src/sh_edraft/messaging/__init__.py index db61154c..873d0fe5 100644 --- a/src/sh_edraft/messaging/__init__.py +++ b/src/sh_edraft/messaging/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.messaging +sh_edraft.messaging ~~~~~~~~~~~~~~~~~~~ @@ -15,11 +15,11 @@ __title__ = 'sh_edraft.messaging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/publishing/__init__.py b/src/sh_edraft/publishing/__init__.py index 3147018a..f6aee612 100644 --- a/src/sh_edraft/publishing/__init__.py +++ b/src/sh_edraft/publishing/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.publishing +sh_edraft.publishing ~~~~~~~~~~~~~~~~~~~ @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.publishing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .publisher import Publisher VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/publishing/base/__init__.py b/src/sh_edraft/publishing/base/__init__.py index 041cfa8f..d57eaf3d 100644 --- a/src/sh_edraft/publishing/base/__init__.py +++ b/src/sh_edraft/publishing/base/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.publishing.base +sh_edraft.publishing.base ~~~~~~~~~~~~~~~~~~~ @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.publishing.base' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .publisher_base import PublisherBase VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/publishing/model/__init__.py b/src/sh_edraft/publishing/model/__init__.py index 98f26949..8b4b4a63 100644 --- a/src/sh_edraft/publishing/model/__init__.py +++ b/src/sh_edraft/publishing/model/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.publishing.base +sh_edraft.publishing.model ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.publishing.base """ -__title__ = 'sh_edraft.publishing.base' +__title__ = 'sh_edraft.publishing.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -26,4 +26,4 @@ from .publish_settings_model import PublishSettings from .publish_settings_name import PublishSettingsName VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/__init__.py b/src/sh_edraft/service/__init__.py index abfc6044..7d487f52 100644 --- a/src/sh_edraft/service/__init__.py +++ b/src/sh_edraft/service/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.services +sh_edraft.service ~~~~~~~~~~~~~~~~~~~ @@ -11,15 +11,15 @@ sh_edraft.services """ -__title__ = 'sh_edraft.services' +__title__ = 'sh_edraft.service' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/base/__init__.py b/src/sh_edraft/service/base/__init__.py index d3d865d7..73148fb0 100644 --- a/src/sh_edraft/service/base/__init__.py +++ b/src/sh_edraft/service/base/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.services.base +sh_edraft.service.base ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.services.base """ -__title__ = 'sh_edraft.services.base' +__title__ = 'sh_edraft.service.base' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .service_base import ServiceBase VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/model/__init__.py b/src/sh_edraft/service/model/__init__.py index b95fe3c2..e268c5ed 100644 --- a/src/sh_edraft/service/model/__init__.py +++ b/src/sh_edraft/service/model/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.services.base +sh_edraft.service.model ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.services.base """ -__title__ = 'sh_edraft.services.base' +__title__ = 'sh_edraft.service.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .provide_state import ProvideState VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/providing/__init__.py b/src/sh_edraft/service/providing/__init__.py index 7817c7f3..d4a3f100 100644 --- a/src/sh_edraft/service/providing/__init__.py +++ b/src/sh_edraft/service/providing/__init__.py @@ -1,4 +1,27 @@ +# -*- coding: utf-8 -*- + +""" +sh_edraft.service.providing +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.service.providing' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + # imports: from .service_provider import ServiceProvider - from .service_provider import ServiceProviderBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/providing/base/__init__.py b/src/sh_edraft/service/providing/base/__init__.py index 4b5ed5b7..740e8631 100644 --- a/src/sh_edraft/service/providing/base/__init__.py +++ b/src/sh_edraft/service/providing/base/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.service.providing.base +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.service.providing.base' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .service_provider_base import ServiceProviderBase + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/service/providing/model/__init__.py b/src/sh_edraft/service/providing/model/__init__.py index 7c4dd264..779edb8d 100644 --- a/src/sh_edraft/service/providing/model/__init__.py +++ b/src/sh_edraft/service/providing/model/__init__.py @@ -1,3 +1,26 @@ -# imports: +# -*- coding: utf-8 -*- +""" +sh_edraft.service.providing.model +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'sh_edraft.service.providing.model' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: from .provide_state import ProvideState + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/time/__init__.py b/src/sh_edraft/time/__init__.py index 8b6e4c87..d8460af8 100644 --- a/src/sh_edraft/time/__init__.py +++ b/src/sh_edraft/time/__init__.py @@ -15,11 +15,11 @@ __title__ = 'sh_edraft.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/time/model/__init__.py b/src/sh_edraft/time/model/__init__.py index 6686c3d3..1056120c 100644 --- a/src/sh_edraft/time/model/__init__.py +++ b/src/sh_edraft/time/model/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_edraft.time.base +sh_edraft.time.model ~~~~~~~~~~~~~~~~~~~ @@ -11,11 +11,11 @@ sh_edraft.time.base """ -__title__ = 'sh_edraft.time.base' +__title__ = 'sh_edraft.time.model' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names import TimeFormatSettingsNames VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/sh_edraft/utils/__init__.py b/src/sh_edraft/utils/__init__.py index db025911..ab011b6e 100644 --- a/src/sh_edraft/utils/__init__.py +++ b/src/sh_edraft/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'sh_edraft.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple from .credential_manager import CredentialManager VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/__init__.py b/src/tests/__init__.py index 6d9d25af..924bb32a 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 sh-edraft.de' -__version__ = '2020.12.5' +__version__ = '2020.12.9' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2020, minor=12, micro=5) +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/configuration/__init__.py b/src/tests/configuration/__init__.py index e69de29b..2c43c7cd 100644 --- a/src/tests/configuration/__init__.py +++ b/src/tests/configuration/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.configuration +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.configuration' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/hosting/__init__.py b/src/tests/hosting/__init__.py index e69de29b..dd9b9446 100644 --- a/src/tests/hosting/__init__.py +++ b/src/tests/hosting/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.hosting +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.hosting' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/service_providing/__init__.py b/src/tests/service_providing/__init__.py index e69de29b..97f8de34 100644 --- a/src/tests/service_providing/__init__.py +++ b/src/tests/service_providing/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.service_providing +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.service_providing' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/services/__init__.py b/src/tests/services/__init__.py index e69de29b..ad20eee4 100644 --- a/src/tests/services/__init__.py +++ b/src/tests/services/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.services +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.services' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/services/logging/__init__.py b/src/tests/services/logging/__init__.py index e69de29b..37ae0e14 100644 --- a/src/tests/services/logging/__init__.py +++ b/src/tests/services/logging/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.services.logging +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.services.logging' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests/services/publishing/__init__.py b/src/tests/services/publishing/__init__.py index e69de29b..dbe20dd2 100644 --- a/src/tests/services/publishing/__init__.py +++ b/src/tests/services/publishing/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests.services.publishing +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests.services.publishing' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests_dev/__init__.py b/src/tests_dev/__init__.py index e69de29b..caf789c0 100644 --- a/src/tests_dev/__init__.py +++ b/src/tests_dev/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests_dev +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests_dev' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests_dev/db/__init__.py b/src/tests_dev/db/__init__.py index e69de29b..44b89a68 100644 --- a/src/tests_dev/db/__init__.py +++ b/src/tests_dev/db/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +tests_dev.db +~~~~~~~~~~~~~~~~~~~ + + + +:copyright: (c) 2020 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'tests_dev.db' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 sh-edraft.de' +__version__ = '2020.12.9' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2020, minor=12, micro=9) diff --git a/src/tests_dev/publisher.py b/src/tests_dev/publisher.py index 78b8ddf4..f07de2f0 100644 --- a/src/tests_dev/publisher.py +++ b/src/tests_dev/publisher.py @@ -21,7 +21,6 @@ class Program(ApplicationBase): self._configuration: Optional[ConfigurationBase] = None self._logger: Optional[LoggerBase] = None self._publisher: Optional[PublisherBase] = None - # Console.disable() def create_application_host(self): self._app_host = ApplicationHost() @@ -38,7 +37,6 @@ class Program(ApplicationBase): def create_services(self): # Add and create logger - Console.enable() self._services.add_singleton(LoggerBase, Logger) self._logger = self._services.get_service(LoggerBase) @@ -53,8 +51,6 @@ class Program(ApplicationBase): self._logger.debug(__name__, f'Customer: {self._configuration.environment.customer}') self._publisher.exclude('../tests') self._publisher.exclude('../tests_dev') - # self._publisher.include() - # self._publisher.create() self._publisher.create() self._publisher.publish()