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

Method measure

rich/console.py:1277–1292  ·  view source on GitHub ↗

Measure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains information regarding the number of characters required to print the renderable. Args: renderable (RenderableType): Any renderable or string. options (Optional[ConsoleOpt

(
        self, renderable: RenderableType, *, options: Optional[ConsoleOptions] = None
    )

Source from the content-addressed store, hash-verified

1275 return ScreenContext(self, hide_cursor=hide_cursor, style=style or "")
1276
1277 def measure(
1278 self, renderable: RenderableType, *, options: Optional[ConsoleOptions] = None
1279 ) -> Measurement:
1280 """Measure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains
1281 information regarding the number of characters required to print the renderable.
1282
1283 Args:
1284 renderable (RenderableType): Any renderable or string.
1285 options (Optional[ConsoleOptions], optional): Options to use when measuring, or None
1286 to use default options. Defaults to None.
1287
1288 Returns:
1289 Measurement: A measurement of the renderable.
1290 """
1291 measurement = Measurement.get(self, options or self.options, renderable)
1292 return measurement
1293
1294 def render(
1295 self, renderable: RenderableType, options: Optional[ConsoleOptions] = None

Callers 4

test_measure_prettyFunction · 0.95
table_movie.pyFile · 0.80
__rich_console__Method · 0.80
__rich_console__Method · 0.80

Calls 1

getMethod · 0.45

Tested by 1

test_measure_prettyFunction · 0.76