MCPcopy
hub / github.com/langchain-ai/deepagents / pause

Method pause

libs/code/deepagents_code/widgets/loading.py:180–200  ·  view source on GitHub ↗

Pause the animation and update status. Args: status: Status to show while paused

(self, status: str = "Awaiting decision")

Source from the content-addressed store, hash-verified

178 self._status_widget.update(f" {self._status}... ")
179
180 def pause(self, status: str = "Awaiting decision") -> None:
181 """Pause the animation and update status.
182
183 Args:
184 status: Status to show while paused
185 """
186 self._paused = True
187 if self._start_time is not None:
188 self._paused_elapsed = time() - self._start_time
189 self._status = status
190 if self._status_widget:
191 self._status_widget.update(f" {status}... ")
192 if self._hint_widget:
193 # Display whole seconds to match the live counter in
194 # `_update_animation`; `_paused_elapsed` stays a float only so
195 # `resume()` can rebase `_start_time` with sub-second precision.
196 self._hint_widget.update(
197 f"(paused at {format_duration(int(self._paused_elapsed))})"
198 )
199 if self._spinner_widget:
200 self._spinner_widget.update(Content.styled(get_glyphs().pause, "dim"))
201
202 def resume(self) -> None:
203 """Resume the animation, excluding the paused interval from elapsed time.

Calls 2

format_durationFunction · 0.90
get_glyphsFunction · 0.90