2021.4.1 #11

Merged
edraft merged 172 commits from 2021.04.01 into 2021.04 2021-03-21 20:04:24 +01:00
8 changed files with 29 additions and 15 deletions
Showing only changes of commit db21d88721 - Show all commits

View File

@ -20,6 +20,12 @@ __version__ = '2021.4.1'
from collections import namedtuple
# imports:
from .build_service import BuildService
from .generate_service import GenerateService
from .help_service import HelpService
from .new_service import NewService
from .publish_service import PublishService
from .version_service import VersionService
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2021, minor=4, micro=1)

View File

@ -13,7 +13,7 @@ from cpl_cli.configuration.build_settings import BuildSettings
from cpl_cli.configuration.build_settings_name_enum import BuildSettingsName
from cpl_cli.configuration.project_settings import ProjectSettings
from cpl_cli.configuration.project_settings_name_enum import ProjectSettingsName
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsName
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum
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
@ -46,9 +46,9 @@ class NewService(CommandABC):
self._project_dict = {
ProjectSettingsName.name.value: name,
ProjectSettingsName.version.value: {
VersionSettingsName.major.value: '0',
VersionSettingsName.minor.value: '0',
VersionSettingsName.micro.value: '0'
VersionSettingsNameEnum.major.value: '0',
VersionSettingsNameEnum.minor.value: '0',
VersionSettingsNameEnum.micro.value: '0'
},
ProjectSettingsName.author.value: '',
ProjectSettingsName.author_email.value: '',

View File

@ -20,6 +20,12 @@ __version__ = '2021.4.1'
from collections import namedtuple
# imports:
from .build_settings import BuildSettings
from .build_settings_name_enum import BuildSettingsName
from .project_settings import ProjectSettings
from .project_settings_name_enum import ProjectSettingsName
from .version_settings import VersionSettings
from .version_settings_name_enum import VersionSettingsNameEnum
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2021, minor=4, micro=1)

View File

@ -1,7 +1,7 @@
from typing import Optional
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsName
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum
class VersionSettings(ConfigurationModelABC):
@ -34,13 +34,13 @@ class VersionSettings(ConfigurationModelABC):
return f'{self._major}.{self._minor}.{self._micro}'
def from_dict(self, settings: dict):
self._major = int(settings[VersionSettingsName.major.value])
self._minor = int(settings[VersionSettingsName.minor.value])
self._micro = int(settings[VersionSettingsName.micro.value])
self._major = int(settings[VersionSettingsNameEnum.major.value])
self._minor = int(settings[VersionSettingsNameEnum.minor.value])
self._micro = int(settings[VersionSettingsNameEnum.micro.value])
def to_dict(self) -> dict:
return {
VersionSettingsName.major.value: self._major,
VersionSettingsName.minor.value: self._minor,
VersionSettingsName.micro.value: self._micro
VersionSettingsNameEnum.major.value: self._major,
VersionSettingsNameEnum.minor.value: self._minor,
VersionSettingsNameEnum.micro.value: self._micro
}

View File

@ -1,7 +1,7 @@
from enum import Enum
class VersionSettingsName(Enum):
class VersionSettingsNameEnum(Enum):
major = 'Major'
minor = 'Minor'

View File

@ -20,6 +20,8 @@ __version__ = '2021.4.1'
from collections import namedtuple
# imports:
from .publisher_abc import PublisherABC
from .publisher_service import PublisherService
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2021, minor=4, micro=1)

View File

@ -16,7 +16,7 @@ from cpl_cli.templates.build.init_template import InitTemplate
from cpl_cli.templates.publish.setup_template import SetupTemplate
class Publisher(PublisherABC):
class PublisherService(PublisherABC):
def __init__(self, runtime: ApplicationRuntimeABC, project: ProjectSettings, build: BuildSettings):
PublisherABC.__init__(self)

View File

@ -14,7 +14,7 @@ from cpl_cli.command_handler_service import CommandHandler
from cpl_cli.command.help_service import HelpService
from cpl_cli.command.version_service import VersionService
from cpl_cli.error import Error
from cpl_cli.publish.publisher_service import Publisher
from cpl_cli.publish.publisher_service import PublisherService
from cpl_cli.publish.publisher_abc import PublisherABC
@ -64,7 +64,7 @@ class Startup(StartupABC):
def create_services(self) -> ServiceProviderABC:
self._services.add_singleton(CommandHandler)
self._services.add_transient(PublisherABC, Publisher)
self._services.add_transient(PublisherABC, PublisherService)
self._services.add_transient(BuildService)
self._services.add_transient(GenerateService)