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

Method update

rich/console.py:414–430  ·  view source on GitHub ↗

Update the screen. Args: renderable (RenderableType, optional): Optional renderable to replace current renderable, or None for no change. Defaults to None. style: (Style, optional): Replacement style, or None for no change. Defaults to None.

(
        self, *renderables: RenderableType, style: Optional[StyleType] = None
    )

Source from the content-addressed store, hash-verified

412 self._changed = False
413
414 def update(
415 self, *renderables: RenderableType, style: Optional[StyleType] = None
416 ) -> None:
417 """Update the screen.
418
419 Args:
420 renderable (RenderableType, optional): Optional renderable to replace current renderable,
421 or None for no change. Defaults to None.
422 style: (Style, optional): Replacement style, or None for no change. Defaults to None.
423 """
424 if renderables:
425 self.screen.renderable = (
426 Group(*renderables) if len(renderables) > 1 else renderables[0]
427 )
428 if style is not None:
429 self.screen.style = style
430 self.console.print(self.screen, end="")
431
432 def __enter__(self) -> "ScreenContext":
433 self._changed = self.console.set_alt_screen(True)

Callers 1

printMethod · 0.45

Calls 2

GroupClass · 0.85
printMethod · 0.80

Tested by

no test coverage detected