Skip to content

Commit

Permalink
Remove useless function step_progress_update
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Jul 29, 2024
1 parent a7f4103 commit fada8e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions modal/_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ def step_progress(text: str = "") -> Spinner:
return Spinner(default_spinner, text, style="blue")


def step_progress_update(spinner: Spinner, message: str):
spinner.update(text=message)


def step_completed(message: str, is_substep: bool = False) -> RenderableType:
"""Returns the element to be rendered when a step is completed."""

Expand Down Expand Up @@ -313,7 +309,7 @@ def tasks_at_state(state):
message = f"[blue]{message}[/blue] [grey70]View app at [underline]{self._app_page_url}[/underline][/grey70]"

# Set the new message
step_progress_update(self._status_spinner, message)
self._status_spinner.update(text=message)

def update_snapshot_progress(self, image_id: str, task_progress: api_pb2.TaskProgress) -> None:
# TODO(erikbern): move this to sit on the resolver object, mostly
Expand Down
8 changes: 3 additions & 5 deletions modal/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ def __init__(self, progress: "Optional[Tree]"):
self._step_node = progress.add(self._spinner)

def message(self, message):
from ._output import step_progress_update

if self._spinner is not None:
step_progress_update(self._spinner, message)
self._spinner.update(text=message)

def finish(self, message):
from ._output import step_completed, step_progress_update
from ._output import step_completed

if self._step_node is not None:
step_progress_update(self._spinner, message)
self._spinner.update(text=message)
self._step_node.label = step_completed(message, is_substep=True)


Expand Down

0 comments on commit fada8e3

Please sign in to comment.