Animation#
- class Animation(message_template: str = 'Processing', enable_animation: bool = True)[source]#
Handles displaying an animated spinner with a message during long-running operations.
The
Animation
class provides a simple way to display a rotating spinner along with a customizable message in the terminal, which can be useful for indicating progress in asynchronous tasks.Necessary attributes for controlling the Animation are set up during initialization of Animation objects (e.g., the message template, spinner characters, and color scheme).
- Parameters:
- async start()[source]#
Start the animation as an asyncio task. If animation is disabled, this method does nothing.
- async stop()[source]#
Stops the spinner animation by setting the stop event and waiting for the animation task to complete.