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

Method pad_right

rich/text.py:933–942  ·  view source on GitHub ↗

Pad the right with a given character. Args: count (int): Number of characters to pad. character (str, optional): Character to pad with. Defaults to " ".

(self, count: int, character: str = " ")

Source from the content-addressed store, hash-verified

931 ]
932
933 def pad_right(self, count: int, character: str = " ") -> None:
934 """Pad the right with a given character.
935
936 Args:
937 count (int): Number of characters to pad.
938 character (str, optional): Character to pad with. Defaults to " ".
939 """
940 assert len(character) == 1, "Character must be a string of length 1"
941 if count:
942 self.plain = f"{self.plain}{character * count}"
943
944 def align(self, align: AlignMethod, width: int, character: str = " ") -> None:
945 """Align text to a given width.

Callers 4

test_pad_rightFunction · 0.95
set_lengthMethod · 0.95
alignMethod · 0.95
justifyMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_pad_rightFunction · 0.76