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

Method update_width

rich/console.py:194–205  ·  view source on GitHub ↗

Update just the width, return a copy. Args: width (int): New width (sets both min_width and max_width) Returns: ~ConsoleOptions: New console options instance.

(self, width: int)

Source from the content-addressed store, hash-verified

192 return options
193
194 def update_width(self, width: int) -> "ConsoleOptions":
195 """Update just the width, return a copy.
196
197 Args:
198 width (int): New width (sets both min_width and max_width)
199
200 Returns:
201 ~ConsoleOptions: New console options instance.
202 """
203 options = self.copy()
204 options.min_width = options.max_width = max(0, width)
205 return options
206
207 def update_height(self, height: int) -> "ConsoleOptions":
208 """Update the height, and return a copy.

Callers 12

test_rich_measureFunction · 0.80
test_min_widthFunction · 0.80
test_width_of_noneFunction · 0.80
test_measure_renderablesFunction · 0.80
__rich_console__Method · 0.80
__rich_measure__Method · 0.80
__rich_measure__Method · 0.80
__rich_console__Method · 0.80
__rich_console__Method · 0.80
__rich_measure__Method · 0.80
__rich_console__Method · 0.80

Calls 1

copyMethod · 0.95

Tested by 4

test_rich_measureFunction · 0.64
test_min_widthFunction · 0.64
test_width_of_noneFunction · 0.64
test_measure_renderablesFunction · 0.64