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

Method with_maximum

rich/measure.py:34–44  ·  view source on GitHub ↗

Get a RenderableWith where the widths are <= width. Args: width (int): Maximum desired width. Returns: Measurement: New Measurement object.

(self, width: int)

Source from the content-addressed store, hash-verified

32 return Measurement(max(0, minimum), max(0, max(minimum, maximum)))
33
34 def with_maximum(self, width: int) -> "Measurement":
35 """Get a RenderableWith where the widths are <= width.
36
37 Args:
38 width (int): Maximum desired width.
39
40 Returns:
41 Measurement: New Measurement object.
42 """
43 minimum, maximum = self
44 return Measurement(min(minimum, width), min(maximum, width))
45
46 def with_minimum(self, width: int) -> "Measurement":
47 """Get a RenderableWith where the widths are >= width.

Callers 4

__rich_measure__Method · 0.95
_measure_columnMethod · 0.80
clampMethod · 0.80
getMethod · 0.80

Calls 1

MeasurementClass · 0.85

Tested by

no test coverage detected