MCPcopy
hub / github.com/Textualize/rich / stop

Method stop

rich/live.py:145–181  ·  view source on GitHub ↗

Stop live rendering display.

(self)

Source from the content-addressed store, hash-verified

143 self._refresh_thread.start()
144
145 def stop(self) -> None:
146 """Stop live rendering display."""
147 with self._lock:
148 if not self._started:
149 return
150 self._started = False
151 self.console.clear_live()
152 if self._nested:
153 if not self.transient:
154 self.console.print(self.renderable)
155 return
156
157 if self.auto_refresh and self._refresh_thread is not None:
158 self._refresh_thread.stop()
159 self._refresh_thread = None
160 # allow it to fully render on the last even if overflow
161 self.vertical_overflow = "visible"
162 with self.console:
163 try:
164 if not self._alt_screen and not self.console.is_jupyter:
165 self.refresh()
166 finally:
167 self._disable_redirect_io()
168 self.console.pop_render_hook()
169 if (
170 not self._alt_screen
171 and self.console.is_terminal
172 and self._live_render.last_render_height
173 ):
174 self.console.line()
175 self.console.show_cursor(True)
176 if self._alt_screen:
177 self.console.set_alt_screen(False)
178 if self.transient and not self._alt_screen:
179 self.console.control(self._live_render.restore_cursor())
180 if self.ipy_widget is not None and self.transient:
181 self.ipy_widget.close() # pragma: no cover
182
183 def __enter__(self) -> Self:
184 self.start(refresh=self._renderable is not None)

Callers 4

startMethod · 0.95
__exit__Method · 0.95
test_live_stateFunction · 0.45
render_progressFunction · 0.45

Calls 11

refreshMethod · 0.95
_disable_redirect_ioMethod · 0.95
clear_liveMethod · 0.80
printMethod · 0.80
pop_render_hookMethod · 0.80
set_alt_screenMethod · 0.80
controlMethod · 0.80
restore_cursorMethod · 0.80
lineMethod · 0.45
show_cursorMethod · 0.45
closeMethod · 0.45

Tested by 2

test_live_stateFunction · 0.36
render_progressFunction · 0.36