Console spinner bugfixes for linux terminal

This commit is contained in:
2021-03-15 20:33:20 +01:00
parent 26ec121079
commit 121b9b84a0
3 changed files with 50 additions and 23 deletions

View File

@@ -3,24 +3,27 @@ from cpl.console import Console, ForegroundColorEnum
def test_spinner():
time.sleep(3)
time.sleep(2)
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}\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}')
Console.write_line()