2from typing
import Optional, Tuple
5 from typing
import Literal
10from ._loop
import loop_last
11from .console
import Console, ConsoleOptions, RenderableType, RenderResult
12from .control
import Control
13from .segment
import ControlType, Segment
14from .style
import StyleType
17VerticalOverflowMethod = Literal[
"crop",
"ellipsis",
"visible"]
21 """Creates a renderable that may be updated.
24 renderable (RenderableType): Any renderable object.
25 style (StyleType, optional): An optional style to apply to the renderable. Defaults to "".
30 renderable: RenderableType,
31 style: StyleType =
"",
32 vertical_overflow: VerticalOverflowMethod =
"ellipsis",
37 self.
_shape: Optional[Tuple[int, int]] =
None
40 """Set a new renderable.
43 renderable (RenderableType): Any renderable object, including str.
48 """Get control codes to move cursor to beginning of live render.
51 Control: A control instance that may be printed.
53 if self.
_shape is not None:
69 """Get control codes to clear the render and restore the cursor to its previous position.
72 Control: A Control instance that may be printed.
74 if self.
_shape is not None:
83 self, console: Console, options: ConsoleOptions
103 style=
"live.ellipsis",
110 for last, line
in loop_last(lines):
None set_renderable(self, RenderableType renderable)
Control position_cursor(self)
RenderResult __rich_console__(self, Console console, ConsoleOptions options)
None __init__(self, RenderableType renderable, StyleType style="", VerticalOverflowMethod vertical_overflow="ellipsis")
Control restore_cursor(self)