Method: rich.text.Text.pad_left
Calls: 247, Exceptions: 0, Paths: 2Back
Path 1: 192 calls (0.78)
3 (49) 2 (21) 7 (18) 6 (14) 4 (12) 5 (12) 1 (7) 28 (6) 45 (6) 23 (6)
' ' (191) 'X' (1)
1def pad_left(self, count: int, character: str = " ") -> None:
2 """Pad the left with a given character.
3
4 Args:
5 count (int): Number of characters to pad.
6 character (str, optional): Character to pad with. Defaults to " ".
7 """
8 assert len(character) == 1, "Character must be a string of length 1"
9 if count:
10 self.plain = f"{character * count}{self.plain}"
11 _Span = Span
12 self._spans[:] = [
13 _Span(start + count, end + count, style)
14 for start, end, style in self._spans
15 ]
Path 2: 55 calls (0.22)
0 (55)
' ' (55)
1def pad_left(self, count: int, character: str = " ") -> None:
2 """Pad the left with a given character.
3
4 Args:
5 count (int): Number of characters to pad.
6 character (str, optional): Character to pad with. Defaults to " ".
7 """
8 assert len(character) == 1, "Character must be a string of length 1"
9 if count:
10 self.plain = f"{character * count}{self.plain}"
11 _Span = Span
12 self._spans[:] = [
13 _Span(start + count, end + count, style)
14 for start, end, style in self._spans
15 ]