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

Method rule

rich/console.py:1589–1608  ·  view source on GitHub ↗

Draw a line with optional centered title. Args: title (str, optional): Text to render over the rule. Defaults to "". characters (str, optional): Character(s) to form the line. Defaults to "─". style (str, optional): Style of line. Defaults to "rule.line".

(
        self,
        title: TextType = "",
        *,
        characters: str = "─",
        style: Union[str, Style] = "rule.line",
        align: AlignMethod = "center",
    )

Source from the content-addressed store, hash-verified

1587 return renderables
1588
1589 def rule(
1590 self,
1591 title: TextType = "",
1592 *,
1593 characters: str = "─",
1594 style: Union[str, Style] = "rule.line",
1595 align: AlignMethod = "center",
1596 ) -> None:
1597 """Draw a line with optional centered title.
1598
1599 Args:
1600 title (str, optional): Text to render over the rule. Defaults to "".
1601 characters (str, optional): Character(s) to form the line. Defaults to "─".
1602 style (str, optional): Style of line. Defaults to "rule.line".
1603 align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".
1604 """
1605 from .rule import Rule
1606
1607 rule = Rule(title=title, characters=characters, style=style, align=align)
1608 self.print(rule)
1609
1610 def control(self, *control: Control) -> None:
1611 """Insert non-printing control codes.

Callers 15

renderFunction · 0.95
test_ruleFunction · 0.95
test_rule_errorFunction · 0.95
test_rule_alignFunction · 0.95
test_rule_cjkFunction · 0.95
test_charactersFunction · 0.95
renderFunction · 0.95
print_calendarFunction · 0.95

Calls 2

printMethod · 0.95
RuleClass · 0.85

Tested by 11

renderFunction · 0.76
test_ruleFunction · 0.76
test_rule_errorFunction · 0.76
test_rule_alignFunction · 0.76
test_rule_cjkFunction · 0.76
test_charactersFunction · 0.76
renderFunction · 0.76