2021.4 #19

Merged
edraft merged 237 commits from 2021.4 into master 2021-04-01 10:13:33 +02:00
7 changed files with 46 additions and 23 deletions
Showing only changes of commit 3d001ade0a - Show all commits

View File

@ -1,3 +1,2 @@
- create console select with up & down arrows
- add command start
- add command update

View File

@ -10,7 +10,7 @@ from cpl.configuration.configuration_variable_name_enum import ConfigurationVari
from cpl.configuration.console_argument import ConsoleArgument
from cpl.console.console import Console
from cpl.console.foreground_color_enum import ForegroundColorEnum
from cpl.environment.hosting_environment import HostingEnvironment
from cpl.environment.application_environment import ApplicationEnvironment
from cpl.environment.environment_abc import EnvironmentABC
from cpl.environment.environment_name_enum import EnvironmentNameEnum
@ -20,7 +20,7 @@ class Configuration(ConfigurationABC):
def __init__(self):
ConfigurationABC.__init__(self)
self._hosting_environment = HostingEnvironment()
self._hosting_environment = ApplicationEnvironment()
self._config: dict[Union[type, str], Union[ConfigurationModelABC, str]] = {}
self._argument_types: list[ConsoleArgument] = []
@ -70,7 +70,7 @@ class Configuration(ConfigurationABC):
def _set_variable(self, name: str, value: str):
if name == ConfigurationVariableNameEnum.environment.value:
self._hosting_environment.environment_name = EnvironmentName(value)
self._hosting_environment.environment_name = EnvironmentNameEnum(value)
elif name == ConfigurationVariableNameEnum.name.value:
self._hosting_environment.application_name = value

View File

@ -22,7 +22,7 @@ from collections import namedtuple
# imports:
from .environment_abc import EnvironmentABC
from .environment_name_enum import EnvironmentNameEnum
from .hosting_environment import HostingEnvironment
from .application_environment import ApplicationEnvironment
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2021, minor=4, micro=1)

View File

@ -5,7 +5,7 @@ from cpl.environment.environment_abc import EnvironmentABC
from cpl.environment.environment_name_enum import EnvironmentNameEnum
class HostingEnvironment(EnvironmentABC):
class ApplicationEnvironment(EnvironmentABC):
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production, crp: str = './'):
EnvironmentABC.__init__(self)
@ -21,7 +21,7 @@ class HostingEnvironment(EnvironmentABC):
@environment_name.setter
def environment_name(self, environment_name: str):
self._environment_name = EnvironmentName(environment_name)
self._environment_name = EnvironmentNameEnum(environment_name)
@property
def application_name(self) -> str:

View File

@ -8,8 +8,7 @@ def test_spinner():
if __name__ == '__main__':
Console.write_line('Hello World')
# Console.spinner('Test:', test_spinner, spinner_foreground_color=ForegroundColorEnum.cyan,
# text_foreground_color='green')
Console.spinner('Test:', test_spinner, spinner_foreground_color=ForegroundColorEnum.cyan, text_foreground_color='green')
opts = [
'Option 1',
'Option 2',

View File

@ -1,24 +1,44 @@
{
"ProjectSettings": {
"Name": "sh_cpl.tests",
"Author": "Sven Heidemann",
"Description": "Common Python Library CLI",
"LongDescription": "Common Python Library CLI",
"CopyrightDate": "2020",
"CopyrightName": "sh-edraft.de",
"LicenseName": "MIT",
"LicenseDescription": ", see LICENSE for more details.",
"Version": {
"Major": "2021",
"Minor": "04",
"Micro": "01"
},
"SourcePath": "./",
"DistPath": "../../dist",
"Included": [],
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",
"Description": "sh-edraft Common Python library",
"LongDescription": "sh-edraft Common Python library",
"URL": "https://www.sh-edraft.de",
"CopyrightDate": "2020 - 2021",
"CopyrightName": "sh-edraft.de",
"LicenseName": "MIT",
"LicenseDescription": "MIT, see LICENSE for more details.",
"Dependencies": [
"mysql-connector",
"SQLAlchemy",
"termcolor",
"pyfiglet",
"tabulate",
"pynput"
],
"PythonVersion": ">=3.8"
},
"BuildSettings": {
"SourcePath": "",
"OutputPath": "dist",
"Main": "main",
"EntryPoint": "cpl",
"IncludePackageData": "False",
"Included": [
"*/templates"
],
"Excluded": [
"__pycache__",
"logs"
]
"*/__pycache__",
"*/logs",
"*/tests"
],
"PackageData": {}
}
}

View File

@ -1,8 +1,13 @@
from tests.custom.general.application import Application
from tests.custom.general.startup import Startup
if __name__ == '__main__':
def main():
app = Application()
app.use_startup(Startup)
app.build()
app.run()
if __name__ == '__main__':
main()