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

Class TextColumn

rich/progress.py:616–643  ·  view source on GitHub ↗

A column containing text.

Source from the content-addressed store, hash-verified

614
615
616class TextColumn(ProgressColumn):
617 """A column containing text."""
618
619 def __init__(
620 self,
621 text_format: str,
622 style: StyleType = "none",
623 justify: JustifyMethod = "left",
624 markup: bool = True,
625 highlighter: Optional[Highlighter] = None,
626 table_column: Optional[Column] = None,
627 ) -> None:
628 self.text_format = text_format
629 self.justify: JustifyMethod = justify
630 self.style = style
631 self.markup = markup
632 self.highlighter = highlighter
633 super().__init__(table_column=table_column or Column(no_wrap=True))
634
635 def render(self, task: "Task") -> Text:
636 _text = self.text_format.format(task=task)
637 if self.markup:
638 text = Text.from_markup(_text, style=self.style, justify=self.justify)
639 else:
640 text = Text(_text, style=self.style, justify=self.justify)
641 if self.highlighter:
642 self.highlighter.highlight(text)
643 return text
644
645
646class BarColumn(ProgressColumn):

Callers 11

test_text_columnFunction · 0.90
test_columnsFunction · 0.90
live_progress.pyFile · 0.90
fullscreen.pyFile · 0.90
downloader.pyFile · 0.90
trackFunction · 0.85
wrap_fileFunction · 0.85
openFunction · 0.85
get_default_columnsMethod · 0.85

Calls

no outgoing calls

Tested by 3

test_text_columnFunction · 0.72
test_columnsFunction · 0.72