Method: rich.console.Console.rule
Calls: 20, Exceptions: 1, Paths: 2Back
Path 1: 19 calls (0.95)
'ABCD' (6) 'foo' (5) 'Hello!' (3) '' (2) Text (1) 'foobarbazeggfoobarbazegg' (1) '欢迎!' (1)
'─' (17) '+*' (2)
'rule.line' (19)
'center' (11) 'left' (4) 'right' (4)
1def rule(
2 self,
3 title: TextType = "",
4 *,
5 characters: str = "─",
6 style: Union[str, Style] = "rule.line",
7 align: AlignMethod = "center",
8 ) -> None:
9 """Draw a line with optional centered title.
10
11 Args:
12 title (str, optional): Text to render over the rule. Defaults to "".
13 characters (str, optional): Character(s) to form the line. Defaults to "─".
14 style (str, optional): Style of line. Defaults to "rule.line".
15 align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".
16 """
17 from .rule import Rule
18
19 rule = Rule(title=title, characters=characters, style=style, align=align)
20 self.print(rule)
Path 2: 1 calls (0.05)
'foo' (1)
'─' (1)
'rule.line' (1)
'foo' (1)
ValueError (1)
1def rule(
2 self,
3 title: TextType = "",
4 *,
5 characters: str = "─",
6 style: Union[str, Style] = "rule.line",
7 align: AlignMethod = "center",
8 ) -> None:
9 """Draw a line with optional centered title.
10
11 Args:
12 title (str, optional): Text to render over the rule. Defaults to "".
13 characters (str, optional): Character(s) to form the line. Defaults to "─".
14 style (str, optional): Style of line. Defaults to "rule.line".
15 align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".
16 """
17 from .rule import Rule
18
19 rule = Rule(title=title, characters=characters, style=style, align=align)
20 self.print(rule)