From 9a149ec341b5c33943c4a2d7ece508650f9d9d2c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 10 Mar 2021 11:28:04 +0100 Subject: [PATCH] Improved new console command --- cpl.json | 4 +- src/cpl/logging/logger.py | 14 +-- src/cpl_cli/command/new.py | 84 +++++++++++-- src/cpl_cli/templates/build/init.py | 55 ++++----- src/cpl_cli/templates/new/__init__.py | 25 ++++ src/cpl_cli/templates/new/console/LICENSE | 0 src/cpl_cli/templates/new/console/README.md | 0 src/cpl_cli/templates/new/console/__init__.py | 25 ++++ src/cpl_cli/templates/new/console/license.py | 23 ++++ .../templates/new/console/readme_py.py | 23 ++++ .../templates/new/console/src/__init__.py | 25 ++++ .../templates/new/console/src/application.py | 42 +++++-- src/cpl_cli/templates/new/console/src/main.py | 110 ++++++++++++++++-- .../templates/new/console/src/startup.py | 72 ++++++++---- .../new/console/src/tests/__init__.py | 2 +- .../templates/new/console/src/tests/init.py | 27 +++++ src/cpl_cli/templates/publish/setup.py | 9 +- src/cpl_cli/templates/template.py | 14 --- src/cpl_cli/templates/template_file_abc.py | 19 +++ src/tests/application.py | 2 +- 20 files changed, 466 insertions(+), 109 deletions(-) create mode 100644 src/cpl_cli/templates/new/__init__.py delete mode 100644 src/cpl_cli/templates/new/console/LICENSE delete mode 100644 src/cpl_cli/templates/new/console/README.md create mode 100644 src/cpl_cli/templates/new/console/__init__.py create mode 100644 src/cpl_cli/templates/new/console/license.py create mode 100644 src/cpl_cli/templates/new/console/readme_py.py create mode 100644 src/cpl_cli/templates/new/console/src/__init__.py create mode 100644 src/cpl_cli/templates/new/console/src/tests/init.py delete mode 100644 src/cpl_cli/templates/template.py create mode 100644 src/cpl_cli/templates/template_file_abc.py diff --git a/cpl.json b/cpl.json index b251bfca..b6c92248 100644 --- a/cpl.json +++ b/cpl.json @@ -31,9 +31,7 @@ "Main": "cpl_cli.main", "EntryPoint": "cpl", "IncludePackageData": "False", - "Included": [ - "src/cpl_cli/templates/new/console/src/tests/" - ], + "Included": [], "Excluded": [ "*/__pycache__", "*/logs", diff --git a/src/cpl/logging/logger.py b/src/cpl/logging/logger.py index 039f81b7..69163fec 100644 --- a/src/cpl/logging/logger.py +++ b/src/cpl/logging/logger.py @@ -92,7 +92,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.TRACE.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.TRACE.value: Console.set_foreground_color(ForegroundColor.green) Console.write_line(output) @@ -105,7 +105,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.DEBUG.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.DEBUG.value: Console.set_foreground_color(ForegroundColor.green) Console.write_line(output) @@ -118,7 +118,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.INFO.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.INFO.value: Console.set_foreground_color(ForegroundColor.green) Console.write_line(output) @@ -131,7 +131,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.WARN.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.WARN.value: Console.set_foreground_color(ForegroundColor.yellow) Console.write_line(output) @@ -150,7 +150,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.ERROR.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.ERROR.value: Console.set_foreground_color(ForegroundColor.red) Console.write_line(output) @@ -169,7 +169,7 @@ class Logger(LoggerABC): if self._level.value >= LoggingLevel.FATAL.value: self._append_log(output) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.FATAL.value: Console.set_foreground_color(ForegroundColor.red) Console.write_line(output) @@ -186,7 +186,7 @@ class Logger(LoggerABC): else: output = self._get_string(name, LoggingLevel.ERROR, message) - # check if message can be shown in console + # check if message can be shown in console_old if self._console.value >= LoggingLevel.FATAL.value: Console.set_foreground_color(ForegroundColor.red) Console.write_line(output) diff --git a/src/cpl_cli/command/new.py b/src/cpl_cli/command/new.py index 7f480106..59e8d3af 100644 --- a/src/cpl_cli/command/new.py +++ b/src/cpl_cli/command/new.py @@ -1,7 +1,7 @@ import json import os import sys -from distutils.dir_util import copy_tree +from typing import Optional from cpl.application.application_runtime_abc import ApplicationRuntimeABC from cpl.configuration.configuration_abc import ConfigurationABC @@ -12,6 +12,13 @@ from cpl_cli.configuration.build_settings_name import BuildSettingsName from cpl_cli.configuration.project_settings import ProjectSettings from cpl_cli.configuration.project_settings_name import ProjectSettingsName from cpl_cli.configuration.version_settings_name import VersionSettingsName +from cpl_cli.templates.new.console.license import LicenseTemplate +from cpl_cli.templates.new.console.readme_py import ReadmeTemplate +from cpl_cli.templates.new.console.src.application import ApplicationTemplate +from cpl_cli.templates.new.console.src.main import MainWithApplicationHostAndStartupTemplate, MainWithoutApplicationHostTemplate, MainWithApplicationHostTemplate +from cpl_cli.templates.new.console.src.startup import StartupTemplate +from cpl_cli.templates.new.console.src.tests.init import TestsInitTemplate +from cpl_cli.templates.template_file_abc import TemplateFileABC class New(CommandABC): @@ -29,6 +36,9 @@ class New(CommandABC): self._project_json = {} self._command: str = '' + self._use_application_api: bool = False + self._use_startup: bool = False + self._use_service_providing: bool = False def _create_project_settings(self, name: str): self._project_dict = { @@ -76,12 +86,29 @@ class New(CommandABC): BuildSettings.__name__: self._build_dict } - def _create_project_dir(self): + def _get_project_path(self) -> Optional[str]: project_path = os.path.join(self._runtime.working_directory, self._project.name) if os.path.isdir(project_path) and len(os.listdir(project_path)) > 0: Console.error('Project path is not empty\n') - exit() + return None + return project_path + + def _get_project_informations(self): + result = Console.read('Do you want to use application host? (y/n) ') + if result.lower() == 'y': + self._use_application_api = True + + if self._use_application_api: + result = Console.read('Do you want to use startup? (y/n) ') + if result.lower() == 'y': + self._use_startup = True + + # result = Console.read('Do you want to use service providing? (y/n) ') + # if result.lower() == 'y': + # self._use_service_providing = True + + def _build_project_dir(self, project_path: str): if not os.path.isdir(project_path): os.makedirs(project_path) @@ -89,19 +116,52 @@ class New(CommandABC): project_json.write(json.dumps(self._project_json, indent=4)) project_json.close() - template_path = os.path.join(self._runtime.runtime_directory, f'templates/new/{self._command}') - if not os.path.isdir(template_path): - Console.error(template_path, '\n\nTemplate path not found\n') - exit() + templates: list[TemplateFileABC] = [ + LicenseTemplate(), + ReadmeTemplate(), + TestsInitTemplate() + ] + if self._use_application_api: + templates.append(ApplicationTemplate()) + if self._use_startup: + templates.append(StartupTemplate()) + templates.append(MainWithApplicationHostAndStartupTemplate()) + else: + templates.append(MainWithApplicationHostTemplate()) + else: + templates.append(MainWithoutApplicationHostTemplate()) - copy_tree(template_path, project_path) + for template in templates: + Console.spinner(f'Creating {template.path}{template.name}', self._create_template, project_path, template) + + @staticmethod + def _create_template(project_path: str, template: TemplateFileABC): + file_path = os.path.join(project_path, template.path, template.name) + file_rel_path = os.path.join(project_path, template.path) + + if not os.path.isdir(file_rel_path): + os.makedirs(file_rel_path) + + with open(file_path, 'w') as license_file: + license_file.write(template.value) + license_file.close() def _console(self, args: list[str]): name = self._config.get_configuration(self._command) - self._create_project_settings(name) - self._create_build_settings() - self._create_project_json() - self._create_project_dir() + + Console.spinner('Creating project settings', self._create_project_settings, name) + Console.spinner('Creating build settings', self._create_build_settings) + path = self._get_project_path() + if path is None: + return + + Console.spinner('Creating project file', self._create_project_json) + Console.write_line('Building project directory:') + self._get_project_informations() + try: + self._build_project_dir(path) + except Exception as e: + Console.error('Could not create project', str(e)) def run(self, args: list[str]): self._command = args[0] diff --git a/src/cpl_cli/templates/build/init.py b/src/cpl_cli/templates/build/init.py index 44f43e57..0d74cc11 100644 --- a/src/cpl_cli/templates/build/init.py +++ b/src/cpl_cli/templates/build/init.py @@ -1,35 +1,36 @@ -from cpl_cli.templates.template import Template +import textwrap class Init: @staticmethod def get_init_py() -> str: - string = """# -*- coding: utf-8 -*- - - \"\"\" - $Name $Description - ~~~~~~~~~~~~~~~~~~~ + string = textwrap.dedent("""\ + # -*- coding: utf-8 -*- - $LongDescription - - :copyright: (c) $CopyrightDate $CopyrightName - :license: $LicenseDescription - - \"\"\" - - __title__ = '$Title' - __author__ = '$Author' - __license__ = '$LicenseName' - __copyright__ = 'Copyright (c) $CopyrightDate $CopyrightName' - __version__ = '$Version' - - from collections import namedtuple - - $Imports - - VersionInfo = namedtuple('VersionInfo', 'major minor micro') - version_info = VersionInfo(major=$Major, minor=$Minor, micro=$Micro) - """ + \"\"\" + $Name $Description + ~~~~~~~~~~~~~~~~~~~ + + $LongDescription + + :copyright: (c) $CopyrightDate $CopyrightName + :license: $LicenseDescription + + \"\"\" + + __title__ = '$Title' + __author__ = '$Author' + __license__ = '$LicenseName' + __copyright__ = 'Copyright (c) $CopyrightDate $CopyrightName' + __version__ = '$Version' + + from collections import namedtuple + + $Imports + + VersionInfo = namedtuple('VersionInfo', 'major minor micro') + version_info = VersionInfo(major=$Major, minor=$Minor, micro=$Micro) + """) - return Template.build_template_string(string) + return string diff --git a/src/cpl_cli/templates/new/__init__.py b/src/cpl_cli/templates/new/__init__.py new file mode 100644 index 00000000..4591916e --- /dev/null +++ b/src/cpl_cli/templates/new/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +sh_cpl sh-edraft Common Python library +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library + +:copyright: (c) 2020 - 2021 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli.templates.new' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' +__version__ = '2021.4.1' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2021, minor=4, micro=1) diff --git a/src/cpl_cli/templates/new/console/LICENSE b/src/cpl_cli/templates/new/console/LICENSE deleted file mode 100644 index e69de29b..00000000 diff --git a/src/cpl_cli/templates/new/console/README.md b/src/cpl_cli/templates/new/console/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/src/cpl_cli/templates/new/console/__init__.py b/src/cpl_cli/templates/new/console/__init__.py new file mode 100644 index 00000000..ed985dc9 --- /dev/null +++ b/src/cpl_cli/templates/new/console/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +sh_cpl sh-edraft Common Python library +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library + +:copyright: (c) 2020 - 2021 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli.templates.new.console' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' +__version__ = '2021.4.1' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2021, minor=4, micro=1) diff --git a/src/cpl_cli/templates/new/console/license.py b/src/cpl_cli/templates/new/console/license.py new file mode 100644 index 00000000..d9bcdda7 --- /dev/null +++ b/src/cpl_cli/templates/new/console/license.py @@ -0,0 +1,23 @@ +from cpl_cli.templates.template_file_abc import TemplateFileABC + + +class LicenseTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'LICENSE' + self._path = '' + self._value = """""" + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/new/console/readme_py.py b/src/cpl_cli/templates/new/console/readme_py.py new file mode 100644 index 00000000..7af465a4 --- /dev/null +++ b/src/cpl_cli/templates/new/console/readme_py.py @@ -0,0 +1,23 @@ +from cpl_cli.templates.template_file_abc import TemplateFileABC + + +class ReadmeTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'README.md' + self._path = '' + self._value = """""" + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/new/console/src/__init__.py b/src/cpl_cli/templates/new/console/src/__init__.py new file mode 100644 index 00000000..7244fc75 --- /dev/null +++ b/src/cpl_cli/templates/new/console/src/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +sh_cpl sh-edraft Common Python library +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library + +:copyright: (c) 2020 - 2021 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli.templates.new.console.src' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' +__version__ = '2021.4.1' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major=2021, minor=4, micro=1) diff --git a/src/cpl_cli/templates/new/console/src/application.py b/src/cpl_cli/templates/new/console/src/application.py index 68f52e71..5126403e 100644 --- a/src/cpl_cli/templates/new/console/src/application.py +++ b/src/cpl_cli/templates/new/console/src/application.py @@ -1,14 +1,40 @@ -from cpl.application.application_abc import ApplicationABC -from cpl.console.console import Console +import textwrap + +from cpl_cli.templates.template_file_abc import TemplateFileABC -class Application(ApplicationABC): +class ApplicationTemplate(TemplateFileABC): def __init__(self): - ApplicationABC.__init__(self) + TemplateFileABC.__init__(self) - def configure(self): - pass + self._name = 'application.py' + self._path = 'src/' + self._value = textwrap.dedent("""\ + from cpl.application.application_abc import ApplicationABC + from cpl.console.console import Console + + + class Application(ApplicationABC): + + def __init__(self): + ApplicationABC.__init__(self) + + def configure(self): + pass + + def main(self): + Console.write_line('Hello World') + """) - def main(self): - Console.write_line('Hello World') + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/new/console/src/main.py b/src/cpl_cli/templates/new/console/src/main.py index 27456a7f..85a81d87 100644 --- a/src/cpl_cli/templates/new/console/src/main.py +++ b/src/cpl_cli/templates/new/console/src/main.py @@ -1,13 +1,105 @@ -from startup import Startup -from application import Application +import textwrap + +from cpl_cli.templates.template_file_abc import TemplateFileABC -def main(): - app = Application() - app.use_startup(Startup) - app.build() - app.run() +class MainWithApplicationHostAndStartupTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'main.py' + self._path = 'src/' + self._value = textwrap.dedent("""\ + from startup import Startup + from application import Application + + + def main(): + app = Application() + app.use_startup(Startup) + app.build() + app.run() + + + if __name__ == '__main__': + main() + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value -if __name__ == '__main__': - main() +class MainWithApplicationHostTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'main.py' + self._path = 'src/' + self._value = textwrap.dedent("""\ + from application import Application + + + def main(): + app = Application() + app.build() + app.run() + + + if __name__ == '__main__': + main() + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value + + +class MainWithoutApplicationHostTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'main.py' + self._path = 'src/' + self._value = textwrap.dedent("""\ + from cpl.console.console import Console + + + def main(): + Console.write_line('Hello World') + + + if __name__ == '__main__': + main() + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/new/console/src/startup.py b/src/cpl_cli/templates/new/console/src/startup.py index 1b6eea85..f7023854 100644 --- a/src/cpl_cli/templates/new/console/src/startup.py +++ b/src/cpl_cli/templates/new/console/src/startup.py @@ -1,33 +1,59 @@ -from typing import Optional +import textwrap -from cpl.application.application_host import ApplicationHost -from cpl.application.application_host_abc import ApplicationHostABC -from cpl.application.startup_abc import StartupABC -from cpl.configuration.configuration_abc import ConfigurationABC -from cpl.dependency_injection.service_provider_abc import ServiceProviderABC +from cpl_cli.templates.template_file_abc import TemplateFileABC -class Startup(StartupABC): +class StartupTemplate(TemplateFileABC): def __init__(self): - StartupABC.__init__(self) + TemplateFileABC.__init__(self) - self._app_host: Optional[ApplicationHostABC] = None - self._configuration: Optional[ConfigurationABC] = None - self._services: Optional[ServiceProviderABC] = None + self._name = 'startup.py' + self._path = 'src/' + self._value = textwrap.dedent("""\ + from typing import Optional - def create_application_host(self) -> ApplicationHostABC: - self._app_host = ApplicationHost() - self._configuration = self._app_host.configuration - self._services = self._app_host.services - return self._app_host + from cpl.application.application_host import ApplicationHost + from cpl.application.application_host_abc import ApplicationHostABC + from cpl.application.startup_abc import StartupABC + from cpl.configuration.configuration_abc import ConfigurationABC + from cpl.dependency_injection.service_provider_abc import ServiceProviderABC + + + class Startup(StartupABC): + + def __init__(self): + StartupABC.__init__(self) + + self._app_host: Optional[ApplicationHostABC] = None + self._configuration: Optional[ConfigurationABC] = None + self._services: Optional[ServiceProviderABC] = None + + def create_application_host(self) -> ApplicationHostABC: + self._app_host = ApplicationHost() + self._configuration = self._app_host.configuration + self._services = self._app_host.services + return self._app_host + + def create_configuration(self) -> ConfigurationABC: + pass + + return self._configuration + + def create_services(self) -> ServiceProviderABC: + pass + + return self._services + """) - def create_configuration(self) -> ConfigurationABC: - pass + @property + def name(self) -> str: + return self._name - return self._configuration + @property + def path(self) -> str: + return self._path - def create_services(self) -> ServiceProviderABC: - pass - - return self._services + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/new/console/src/tests/__init__.py b/src/cpl_cli/templates/new/console/src/tests/__init__.py index 0d1131c8..20960274 100644 --- a/src/cpl_cli/templates/new/console/src/tests/__init__.py +++ b/src/cpl_cli/templates/new/console/src/tests/__init__.py @@ -11,7 +11,7 @@ sh-edraft Common Python library """ -__title__ = 'cpl_cli.templates.new.console.src.tests' +__title__ = 'cpl_cli.templates.new.console_old.src.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' diff --git a/src/cpl_cli/templates/new/console/src/tests/init.py b/src/cpl_cli/templates/new/console/src/tests/init.py new file mode 100644 index 00000000..3358c6f6 --- /dev/null +++ b/src/cpl_cli/templates/new/console/src/tests/init.py @@ -0,0 +1,27 @@ +import textwrap + +from cpl_cli.templates.template_file_abc import TemplateFileABC + + +class TestsInitTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = '__init__.py' + self._path = 'src/tests/' + self._value = textwrap.dedent("""\ + # imports: + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/templates/publish/setup.py b/src/cpl_cli/templates/publish/setup.py index f03b63af..315f9bef 100644 --- a/src/cpl_cli/templates/publish/setup.py +++ b/src/cpl_cli/templates/publish/setup.py @@ -1,11 +1,12 @@ -from cpl_cli.templates.template import Template +import textwrap class Setup: @staticmethod def get_setup_py() -> str: - string = """\"\"\" + string = textwrap.dedent("""\ + \"\"\" This file is generated by CPL CLI \"\"\" @@ -26,6 +27,6 @@ class Setup: entry_points=$EntryPoints, package_data=$PackageData ) - """ + """) - return Template.build_template_string(string) + return string diff --git a/src/cpl_cli/templates/template.py b/src/cpl_cli/templates/template.py deleted file mode 100644 index fb1ee429..00000000 --- a/src/cpl_cli/templates/template.py +++ /dev/null @@ -1,14 +0,0 @@ -class Template: - - @staticmethod - def build_template_string(string: str) -> str: - return_value = '' - for i in range(0, len(string.splitlines())): - line = string.splitlines()[i] - if i == len(string.splitlines())-1: - return_value += f'{line.strip()}' - break - - return_value += f'{line.strip()}\n' - - return return_value diff --git a/src/cpl_cli/templates/template_file_abc.py b/src/cpl_cli/templates/template_file_abc.py new file mode 100644 index 00000000..bbe2f2e3 --- /dev/null +++ b/src/cpl_cli/templates/template_file_abc.py @@ -0,0 +1,19 @@ +from abc import ABC, abstractmethod + + +class TemplateFileABC(ABC): + + @abstractmethod + def __init__(self): pass + + @property + @abstractmethod + def name(self) -> str: pass + + @property + @abstractmethod + def path(self) -> str: pass + + @property + @abstractmethod + def value(self) -> str: pass diff --git a/src/tests/application.py b/src/tests/application.py index fa4b9916..2cdecb8c 100644 --- a/src/tests/application.py +++ b/src/tests/application.py @@ -25,7 +25,7 @@ class Application(ApplicationABC): self._mailer.send_mail(mail) def test_console(self): - self._logger.debug(__name__, 'Started console test') + self._logger.debug(__name__, 'Started console_old test') Console.write_line('Hello World') Console.write('\nName: ') Console.write_line('Hello', Console.read_line())