Console bugfixes
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
"LicenseName": "",
|
||||
"LicenseDescription": "",
|
||||
"Dependencies": [
|
||||
"sh_cpl==2021.4.1.post3"
|
||||
"sh_cpl==2021.4.1.post4"
|
||||
],
|
||||
"PythonVersion": ">=3.9.2",
|
||||
"Classifiers": []
|
||||
|
@@ -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__':
|
||||
|
22
src/tests/custom/cpl-test/src/model/test_model.py
Normal file
22
src/tests/custom/cpl-test/src/model/test_model.py
Normal 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)
|
@@ -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())
|
||||
|
Reference in New Issue
Block a user