pyrtma.compile.install
- install(*, console=None, width=100, extra_lines=3, theme=None, word_wrap=False, show_locals=False, locals_max_length=10, locals_max_string=80, locals_hide_dunder=True, locals_hide_sunder=None, indent_guides=True, suppress=(), max_frames=100)[source]
Install a rich traceback handler.
Once installed, any tracebacks will be printed with syntax highlighting and rich formatting.
- Parameters:
console (Optional[Console], optional) – Console to write exception to. Default uses internal Console instance.
width (Optional[int], optional) – Width (in characters) of traceback. Defaults to 100.
extra_lines (int, optional) – Extra lines of code. Defaults to 3.
theme (Optional[str], optional) – Pygments theme to use in traceback. Defaults to
None
which will pick a theme appropriate for the platform.word_wrap (bool, optional) – Enable word wrapping of long lines. Defaults to False.
show_locals (bool, optional) – Enable display of local variables. Defaults to False.
locals_max_length (int, optional) – Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10.
locals_max_string (int, optional) – Maximum length of string before truncating, or None to disable. Defaults to 80.
locals_hide_dunder (bool, optional) – Hide locals prefixed with double underscore. Defaults to True.
locals_hide_sunder (bool, optional) – Hide locals prefixed with single underscore. Defaults to False.
indent_guides (bool, optional) – Enable indent guides in code and locals. Defaults to True.
suppress (Sequence[Union[str, ModuleType]]) – Optional sequence of modules or paths to exclude from traceback.
max_frames (int) –
- Returns:
The previous exception handler that was replaced.
- Return type:
Callable