Fixed invalid output after console spinner #122

This commit is contained in:
2022-12-03 23:30:54 +01:00
parent 301768b842
commit e4aedb354b
2 changed files with 28 additions and 23 deletions

View File

@@ -3,7 +3,12 @@ from cpl_core.console import Console, ForegroundColorEnum
def test_spinner():
Console.write_line('test1')
Console.write_line('test2', 2)
Console.write_line('test3', 2, 3)
Console.write_line('test4', 2, 3, 4)
time.sleep(2)
Console.write_line('test5')
def test_console():
@@ -17,22 +22,22 @@ def test_console():
if __name__ == '__main__':
Console.write_line('Hello World\n')
# Console.spinner('Test:', test_spinner, spinner_foreground_color=ForegroundColorEnum.cyan, text_foreground_color='green')
opts = [
'Option 1',
'Option 2',
'Option 3',
'Option 4'
]
selected = Console.select(
'>',
'Select item:',
opts,
header_foreground_color=ForegroundColorEnum.blue,
option_foreground_color=ForegroundColorEnum.green,
cursor_foreground_color=ForegroundColorEnum.red
)
Console.write_line(f'You selected: {selected}')
# test_console()
Console.write_line()
Console.spinner('Test:', test_spinner, spinner_foreground_color=ForegroundColorEnum.cyan, text_foreground_color='green')
# opts = [
# 'Option 1',
# 'Option 2',
# 'Option 3',
# 'Option 4'
# ]
# selected = Console.select(
# '>',
# 'Select item:',
# opts,
# header_foreground_color=ForegroundColorEnum.blue,
# option_foreground_color=ForegroundColorEnum.green,
# cursor_foreground_color=ForegroundColorEnum.red
# )
# Console.write_line(f'You selected: {selected}')
# # test_console()
#
# Console.write_line()