MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / Cmd2ExceptionConsole

Class Cmd2ExceptionConsole

cmd2/rich_utils.py:604–624  ·  view source on GitHub ↗

Rich console for printing exceptions and Rich Tracebacks. Ensures that output is always word-wrapped for readability and disables Rich's automatic detection for markup, emoji, and highlighting to prevent interference with raw error data.

Source from the content-addressed store, hash-verified

602
603
604class Cmd2ExceptionConsole(Cmd2BaseConsole):
605 """Rich console for printing exceptions and Rich Tracebacks.
606
607 Ensures that output is always word-wrapped for readability and disables
608 Rich's automatic detection for markup, emoji, and highlighting to prevent
609 interference with raw error data.
610 """
611
612 def __init__(self, *, file: IO[str] | None = None) -> None:
613 """Cmd2ExceptionConsole initializer.
614
615 :param file: optional file object where the console should write to.
616 Defaults to sys.stdout.
617 """
618 super().__init__(
619 file=file,
620 soft_wrap=False,
621 markup=False,
622 emoji=False,
623 highlight=False,
624 )
625
626
627class Cmd2SimpleTable(Table):

Callers 1

format_exceptionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…