Method: rich.box.Box.substitute
Calls: 105, Exceptions: 0, Paths: 3Back
Path 1: 103 calls (0.98)
ConsoleOptions (103)
True (103)
Box (103)
1def substitute(self, options: "ConsoleOptions", safe: bool = True) -> "Box":
2 """Substitute this box for another if it won't render due to platform issues.
3
4 Args:
5 options (ConsoleOptions): Console options used in rendering.
6 safe (bool, optional): Substitute this for another Box if there are known problems
7 displaying on the platform (currently only relevant on Windows). Default is True.
8
9 Returns:
10 Box: A different Box or the same Box.
11 """
12 box = self
13 if options.legacy_windows and safe:
14 box = LEGACY_WINDOWS_SUBSTITUTIONS.get(box, box)
15 if options.ascii_only and not box.ascii:
16 box = ASCII
17 return box
Path 2: 1 calls (0.01)
ConsoleOptions (1)
True (1)
Box (1)
1def substitute(self, options: "ConsoleOptions", safe: bool = True) -> "Box":
2 """Substitute this box for another if it won't render due to platform issues.
3
4 Args:
5 options (ConsoleOptions): Console options used in rendering.
6 safe (bool, optional): Substitute this for another Box if there are known problems
7 displaying on the platform (currently only relevant on Windows). Default is True.
8
9 Returns:
10 Box: A different Box or the same Box.
11 """
12 box = self
13 if options.legacy_windows and safe:
14 box = LEGACY_WINDOWS_SUBSTITUTIONS.get(box, box)
15 if options.ascii_only and not box.ascii:
16 box = ASCII
17 return box
Path 3: 1 calls (0.01)
ConsoleOptions (1)
True (1)
Box (1)
1def substitute(self, options: "ConsoleOptions", safe: bool = True) -> "Box":
2 """Substitute this box for another if it won't render due to platform issues.
3
4 Args:
5 options (ConsoleOptions): Console options used in rendering.
6 safe (bool, optional): Substitute this for another Box if there are known problems
7 displaying on the platform (currently only relevant on Windows). Default is True.
8
9 Returns:
10 Box: A different Box or the same Box.
11 """
12 box = self
13 if options.legacy_windows and safe:
14 box = LEGACY_WINDOWS_SUBSTITUTIONS.get(box, box)
15 if options.ascii_only and not box.ascii:
16 box = ASCII
17 return box