Skip to content

console

Handling the CLIs output to users.

CLASS DESCRIPTION
ConsoleWrapper

A high level console interface.

ConsoleWrapper(
    output_level: OutputLevel, default: Console, warning: Console, error: Console
)

A high level console interface.

This is not a true sub-class of rich.Console, it merely proxies most calls to an underlying rich.Console instance, but that's hard to correctly type with mypy, so lie. Maybe life will be better one day[1].

[1] https://github.com/python/typing/issues/802

Source code in nava/platform/cli/console.py
55
56
57
58
59
60
61
def __init__(
    self, output_level: config.OutputLevel, default: Console, warning: Console, error: Console
) -> None:
    self.output_level = output_level
    self.default = default
    self.warning = warning
    self.error = error