2021.4 #19

Merged
edraft merged 237 commits from 2021.4 into master 2021-04-01 10:13:33 +02:00
8 changed files with 34 additions and 5 deletions
Showing only changes of commit 57bae9f291 - Show all commits

2
.gitignore vendored
View File

@ -37,7 +37,7 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
# Unit model / coverage reports
htmlcov/
.tox/
.nox/

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "2021",
"Minor": "04",
"Micro": "01-4"
"Micro": "01-5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -155,7 +155,11 @@ class Console:
for i in range(0, len(cls._select_menu_items)):
Console.set_foreground_color(cls._selected_menu_cursor_foreground_color)
Console.set_background_color(cls._selected_menu_cursor_background_color)
Console.write_line(f'{cls._selected_menu_item_char if cls._selected_menu_item_index == i else " "} ')
placeholder = ''
for _ in cls._selected_menu_item_char:
placeholder += ' '
Console.write_line(f'{cls._selected_menu_item_char if cls._selected_menu_item_index == i else placeholder} ')
Console.set_foreground_color(cls._selected_menu_option_foreground_color)
Console.set_background_color(cls._selected_menu_option_background_color)
Console.write(f'{cls._select_menu_items[i]}')

View File

@ -16,7 +16,7 @@
"LicenseName": "",
"LicenseDescription": "",
"Dependencies": [
"sh_cpl==2021.4.1.post3"
"sh_cpl==2021.4.1.post4"
],
"PythonVersion": ">=3.9.2",
"Classifiers": []

View File

@ -1,9 +1,12 @@
from cpl.console.console import Console
from model.test_model import TestModel
def main():
Console.write_line('Hello World')
Console.write_line('Dies ist ein test')
test = TestModel()
if __name__ == '__main__':

View File

@ -0,0 +1,22 @@
import time
from cpl.console import Console
class TestModel:
def __init__(self):
Console.spinner('Waiting: ', self._wait, 3)
option = Console.select('->', 'Select option: ', [
'Option 1',
'Option 2',
'Option 3',
'Option 4',
'Option 5',
'Option 6'
])
Console.write_line('You selected', option)
@staticmethod
def _wait(count: int):
time.sleep(count)

View File

@ -27,7 +27,7 @@ class Application(ApplicationABC):
self._mailer.send_mail(mail)
def test_console(self):
self._logger.debug(__name__, 'Started console_old test')
self._logger.debug(__name__, 'Started console_old model')
Console.write_line('Hello World')
Console.write('\nName: ')
Console.write_line(' Hello', Console.read_line())