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

Method get_top

rich/box.py:95–113  ·  view source on GitHub ↗

Get the top of a simple box. Args: widths (List[int]): Widths of columns. Returns: str: A string of box characters.

(self, widths: Iterable[int])

Source from the content-addressed store, hash-verified

93 return PLAIN_HEADED_SUBSTITUTIONS.get(self, self)
94
95 def get_top(self, widths: Iterable[int]) -> str:
96 """Get the top of a simple box.
97
98 Args:
99 widths (List[int]): Widths of columns.
100
101 Returns:
102 str: A string of box characters.
103 """
104
105 parts: List[str] = []
106 append = parts.append
107 append(self.top_left)
108 for last, width in loop_last(widths):
109 append(self.top * width)
110 if not last:
111 append(self.top_divider)
112 append(self.top_right)
113 return "".join(parts)
114
115 def get_row(
116 self,

Callers 3

test_get_topFunction · 0.80
__rich_console__Method · 0.80
_renderMethod · 0.80

Calls 2

loop_lastFunction · 0.85
joinMethod · 0.80

Tested by 1

test_get_topFunction · 0.64