Method: rich.pretty.Node.render
Calls: 170, Exceptions: 0, Paths: 3Back
Path 1: 97 calls (0.57)
48 (16) 80 (14) 15 (8) 26 (8) 1 (8) 27 (8) 29 (4) 46 (4) 34 (4) 50 (3)
4 (97)
False (96) True (1)
'1' (45) '0' (14) ' Path 2: 51 calls (0.3) 80 (39) 100 (3) 56 (2) 26 (1) 20 (1) 60 (1) 19 (1) 14 (1) 18 (1) 58 (1) 4 (51) False (51) 'Example(x=1, y=[Example(x=2, y=None), Example(x=2, y=None)])' (4) 'Example(x=1, y=...)' (3) 'Example(x=1, y=Example(x=2, y=...))' (3) 'Foo(foo=Bar(ba... Path 3: 22 calls (0.13) 80 (7) 6 (6) 100 (2) 86 (2) 85 (1) 41 (1) 16 (1) 10 (1) 8 (1) 4 (22) False (17) True (5) "{\n 'foo': [3.1427, ('Paul Atreides', 'Vladimir Harkonnen', 'Thufir Hawat')],\n 'atomic': (False, True, None)\n}" (5) "Layout(\n name='foo'\...
1def render(
2 self, max_width: int = 80, indent_size: int = 4, expand_all: bool = False
3 ) -> str:
4 """Render the node to a pretty repr.
5
6 Args:
7 max_width (int, optional): Maximum width of the repr. Defaults to 80.
8 indent_size (int, optional): Size of indents. Defaults to 4.
9 expand_all (bool, optional): Expand all levels. Defaults to False.
10
11 Returns:
12 str: A repr string of the original object.
13 """
14 lines = [_Line(node=self, is_root=True)]
15 line_no = 0
16 while line_no < len(lines):
17 line = lines[line_no]
18 if line.expandable and not line.expanded:
19 if expand_all or not line.check_length(max_width):
20 lines[line_no : line_no + 1] = line.expand(indent_size)
21 line_no += 1
22
23 repr_str = "\n".join(str(line) for line in lines)
24 return repr_str
1def render(
2 self, max_width: int = 80, indent_size: int = 4, expand_all: bool = False
3 ) -> str:
4 """Render the node to a pretty repr.
5
6 Args:
7 max_width (int, optional): Maximum width of the repr. Defaults to 80.
8 indent_size (int, optional): Size of indents. Defaults to 4.
9 expand_all (bool, optional): Expand all levels. Defaults to False.
10
11 Returns:
12 str: A repr string of the original object.
13 """
14 lines = [_Line(node=self, is_root=True)]
15 line_no = 0
16 while line_no < len(lines):
17 line = lines[line_no]
18 if line.expandable and not line.expanded:
19 if expand_all or not line.check_length(max_width):
20 lines[line_no : line_no + 1] = line.expand(indent_size)
21 line_no += 1
22
23 repr_str = "\n".join(str(line) for line in lines)
24 return repr_str
1def render(
2 self, max_width: int = 80, indent_size: int = 4, expand_all: bool = False
3 ) -> str:
4 """Render the node to a pretty repr.
5
6 Args:
7 max_width (int, optional): Maximum width of the repr. Defaults to 80.
8 indent_size (int, optional): Size of indents. Defaults to 4.
9 expand_all (bool, optional): Expand all levels. Defaults to False.
10
11 Returns:
12 str: A repr string of the original object.
13 """
14 lines = [_Line(node=self, is_root=True)]
15 line_no = 0
16 while line_no < len(lines):
17 line = lines[line_no]
18 if line.expandable and not line.expanded:
19 if expand_all or not line.check_length(max_width):
20 lines[line_no : line_no + 1] = line.expand(indent_size)
21 line_no += 1
22
23 repr_str = "\n".join(str(line) for line in lines)
24 return repr_str