Skip to content

Commit

Permalink
Ensure loading indicator _start_time is initialised correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Oct 18, 2023
1 parent 63bcf41 commit d0f2971
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/textual/widgets/_loading_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ class LoadingIndicator(Widget):
}
"""

def __init__(
self,
name: str | None = None,
id: str | None = None,
classes: str | None = None,
disabled: bool = False,
):
"""Initialize a loading indicator.
Args:
name: The name of the widget.
id: The ID of the widget in the DOM.
classes: The CSS classes for the widget.
disabled: Whether the widget is disabled or not.
"""
super().__init__(name=name, id=id, classes=classes, disabled=disabled)

self._start_time: float = 0.0
"""The time the loading indicator was mounted (a Unix timestamp)."""

def apply(self, widget: Widget) -> AwaitMount:
"""Apply the loading indicator to a `widget`.
Expand Down

0 comments on commit d0f2971

Please sign in to comment.