from types import TracebackType from typing import Optional, Type
from .console import Console, RenderableType from .jupyter import JupyterMixin from .live import Live from .spinner import Spinner from .style import StyleType
class Status(JupyterMixin): """Displays a status indicator with a 'spinner' animation.
Args:
status (RenderableType): A status renderable (str or Text typically).
console (Console, optional): Console instance to use, orNoneforglobal console. Defaults to None.
spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots".
spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner".
speed (float, optional): Speed factor for spinner animation. Defaults to 1.0.
refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5. """
Args:
status (Optional[RenderableType], optional): New status renderable orNonefor no change. Defaults to None.
spinner (Optional[str], optional): New spinner orNonefor no change. Defaults to None.
spinner_style (Optional[StyleType], optional): New spinner style orNonefor no change. Defaults to None.
speed (Optional[float], optional): Speed factor for spinner animation orNonefor no change. Defaults to None. """ if status isnotNone:
self.status = status if spinner_style isnotNone:
self.spinner_style = spinner_style if speed isnotNone:
self.speed = speed if spinner isnotNone:
self._spinner = Spinner(
spinner, text=self.status, style=self.spinner_style, speed=self.speed
)
self._live.update(self.renderable, refresh=True) else:
self._spinner.update(
text=self.status, style=self.spinner_style, speed=self.speed
)
def start(self) -> None: """Start the status animation."""
self._live.start()
def stop(self) -> None: """Stop the spinner animation."""
self._live.stop()
if __name__ == "__main__": # pragma: no cover from time import sleep
from .console import Console
console = Console() with console.status("[magenta]Covid detector booting up") as status:
sleep(3)
console.log("Importing advanced AI")
sleep(3)
console.log("Advanced Covid AI Ready")
sleep(3)
status.update(status="[bold blue] Scanning for Covid", spinner="earth")
sleep(3)
console.log("Found 10,000,000,000 copies of Covid32.exe")
sleep(3)
status.update(
status="[bold red]Moving Covid32.exe to Trash",
spinner="bouncingBall",
spinner_style="yellow",
)
sleep(5)
console.print("[bold green]Covid deleted successfully")
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.