Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Feb 22, 2020
1 parent 4bbd859 commit 5a61f16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
13 changes: 7 additions & 6 deletions rich/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@


class Rule:
"""A console renderable to draw a horizontal rule (line).
Args:
title (str, optional): Text to render in the rule. Defaults to "".
character (str, optional): Character used to draw the line. Defaults to "─".
"""

def __init__(
self,
title: Union[str, Text] = "",
character: str = "─",
style: Union[str, Style] = "rule.line",
) -> None:
"""A console renderable to draw a horizontal rule (line).
Args:
title (str, optional): Text to render in the rule. Defaults to "".
character (str, optional): Character used to draw the line. Defaults to "─".
"""
self.title = title
self.character = character
self.style = style
Expand Down
19 changes: 10 additions & 9 deletions rich/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,23 @@ class PathHighlighter(RegexHighlighter):


class Traceback:
"""A Console renderable that renders a traceback.
Args:
trace (Trace, optional): A `Trace` object produced from `extract`. Defaults to None, which uses
the last exception.
width (Optional[int], optional): Number of characters used to traceback. Defaults to 100.
extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
theme (str, optional): Override pygments theme used in traceback.
"""

def __init__(
self,
trace: Trace = None,
width: Optional[int] = 88,
extra_lines: int = 3,
theme: Optional[str] = None,
):
"""A Console renderable that renders a traceback.
Args:
trace (Trace, optional): A `Trace` object produced from `extract`. Defaults to None, which uses
the last exception.
width (Optional[int], optional): Number of characters used to traceback. Defaults to 100.
extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
theme (str, optional): Override pygments theme used in traceback.
"""
if trace is None:
exc_type, exc_value, traceback = sys.exc_info()
if exc_type is None or exc_value is None or traceback is None:
Expand Down

0 comments on commit 5a61f16

Please sign in to comment.