manrajgrover/halo
View on GitHubProvide option to render more than one spinner at the same time
Open
#17 opened on Oct 3, 2017
feature requesthacktoberfestup-for-grabs
Repository metrics
- Stars
- (3,022 stars)
- PR merge metrics
- (PR metrics pending)
Description
Suppose you get multiple long tasks at hand. It should be nice to be able to start more than one spinner before finishing the last one
take this as an example:
from halo import Hal
a = start_task_a()
a_spinner = Halo({'text': 'Do A', 'spinner': 'dots'})
a_spinner.start()
a_is_spinning = True
b = start_task_b()
b_spinner = Halo({'text': 'Do B', 'spinner': 'dots'})
b_spinner.start()
b_is_spinning = True
while a_is_spinning or b_is_spinning:
if a.is_finished():
a_spinner.succeed()
a_is_spinning = False
if b.is_finished():
b_spinner.succeed()
b_is_spinning = False