File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING
44
5- from rich .protocol import is_renderable
6-
75if TYPE_CHECKING :
86 from textual .app import RenderResult
97
10- from textual .errors import RenderError
118from textual .visual import Visual , VisualType , visualize
129from textual .widget import Widget
1310
1411
15- def _check_renderable (renderable : object ):
16- """Check if a renderable conforms to the Rich Console protocol
17- (https://rich.readthedocs.io/en/latest/protocol.html)
18-
19- Args:
20- renderable: A potentially renderable object.
21-
22- Raises:
23- RenderError: If the object can not be rendered.
24- """
25- if not is_renderable (renderable ) and not hasattr (renderable , "visualize" ):
26- raise RenderError (
27- f"unable to render { renderable .__class__ .__name__ !r} type; must be a str, Text, Rich renderable oor Textual Visual instance"
28- )
29-
30-
3112class Static (Widget , inherit_bindings = False ):
3213 """A widget to display simple static content, or use as a base class for more complex widgets.
3314
You can’t perform that action at this time.
0 commit comments