Method: rich.panel.Panel.__rich_measure__
Calls: 10, Exceptions: 0, Paths: 2Back
Path 1: 9 calls (0.9)
Console (9)
ConsoleOptions (9)
Measurement (9)
1def __rich_measure__(
2 self, console: "Console", options: "ConsoleOptions"
3 ) -> "Measurement":
4 _title = self._title
5 _, right, _, left = Padding.unpack(self.padding)
6 padding = left + right
7 renderables = [self.renderable, _title] if _title else [self.renderable]
8
9 if self.width is None:
10 width = (
11 measure_renderables(
12 console,
13 options.update_width(options.max_width - padding - 2),
14 renderables,
15 ).maximum
16 + padding
17 + 2
18 )
19 else:
20 width = self.width
21 return Measurement(width, width)
Path 2: 1 calls (0.1)
Console (1)
ConsoleOptions (1)
Measurement (1)
1def __rich_measure__(
2 self, console: "Console", options: "ConsoleOptions"
3 ) -> "Measurement":
4 _title = self._title
5 _, right, _, left = Padding.unpack(self.padding)
6 padding = left + right
7 renderables = [self.renderable, _title] if _title else [self.renderable]
8
9 if self.width is None:
10 width = (
11 measure_renderables(
12 console,
13 options.update_width(options.max_width - padding - 2),
14 renderables,
15 ).maximum
16 + padding
17 + 2
18 )
19 else:
20 width = self.width
21 return Measurement(width, width)