manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.86k stars 148 forks source link

feature request: any appetite for supporting dynamic text? #167

Open davidxia opened 2 years ago

davidxia commented 2 years ago

Description

I'd like the text to be dynamic, e.g. an updating timestamp or time since something happened. I have a prototype here where users can make text a function instead of a static string.

with Halo(text=lambda: f'date {datetime.datetime.now()}'):
    time.sleep(100)

Any appetite for supporting this? If so, any feedback on my PR would be great. I still have to add tests.

Nbelles commented 2 years ago

I have just attempted the changes that were recommended on my local machine and they seem to work well. Thanks for putting in the work! @davidxia

davidxia commented 2 years ago

@Nbelles thanks, hoping the maintainer(s) notice and reply :)