Skip to content

Commit

Permalink
Merge pull request #2669 from Textualize/fix-spinner-docstring
Browse files Browse the repository at this point in the history
Move spinner docstring to class.
  • Loading branch information
willmcgugan committed Nov 30, 2022
2 parents 6a72534 + 777a99d commit ec07c3c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions rich/spinner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@


class Spinner:
"""A spinner animation.
Args:
name (str): Name of spinner (run python -m rich.spinner).
text (RenderableType, optional): A renderable to display at the right of the spinner (str or Text typically). Defaults to "".
style (StyleType, optional): Style for spinner animation. Defaults to None.
speed (float, optional): Speed factor for animation. Defaults to 1.0.
Raises:
KeyError: If name isn't one of the supported spinner animations.
"""

def __init__(
self,
name: str,
Expand All @@ -19,17 +31,6 @@ def __init__(
style: Optional["StyleType"] = None,
speed: float = 1.0,
) -> None:
"""A spinner animation.
Args:
name (str): Name of spinner (run python -m rich.spinner).
text (RenderableType, optional): A renderable to display at the right of the spinner (str or Text typically). Defaults to "".
style (StyleType, optional): Style for spinner animation. Defaults to None.
speed (float, optional): Speed factor for animation. Defaults to 1.0.
Raises:
KeyError: If name isn't one of the supported spinner animations.
"""
try:
spinner = SPINNERS[name]
except KeyError:
Expand Down

0 comments on commit ec07c3c

Please sign in to comment.