2021.4.post1 #31

Merged
edraft merged 92 commits from 2021.4.post1 into master 2021-05-19 09:00:40 +02:00
Showing only changes of commit 703d20f43f - Show all commits

View File

@ -31,16 +31,25 @@ class VersionSettings(ConfigurationModelABC):
return self._micro return self._micro
def to_str(self) -> str: def to_str(self) -> str:
if self._micro is None:
return f'{self._major}.{self._minor}'
else:
return f'{self._major}.{self._minor}.{self._micro}' return f'{self._major}.{self._minor}.{self._micro}'
def from_dict(self, settings: dict): def from_dict(self, settings: dict):
self._major = settings[VersionSettingsNameEnum.major.value] self._major = settings[VersionSettingsNameEnum.major.value]
self._minor = settings[VersionSettingsNameEnum.minor.value] self._minor = settings[VersionSettingsNameEnum.minor.value]
self._micro = settings[VersionSettingsNameEnum.micro.value] micro = settings[VersionSettingsNameEnum.micro.value]
if micro != '':
self._micro = micro
def to_dict(self) -> dict: def to_dict(self) -> dict:
return { version = {
VersionSettingsNameEnum.major.value: self._major, VersionSettingsNameEnum.major.value: self._major,
VersionSettingsNameEnum.minor.value: self._minor, VersionSettingsNameEnum.minor.value: self._minor,
VersionSettingsNameEnum.micro.value: self._micro
} }
if self._micro is not None:
version[VersionSettingsNameEnum.micro.value] = self._micro
return version