Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Edit this page
Toggle table of contents sidebar

# pontos.terminal package

class pontos.terminal.Terminal

  Abstract base class representing a terminal console

  indent(indentation=4)

    A context manager for indenting output using spaces

    Example

        with terminal.indent():
            terminal.print("...")

    Parameters:

      indentation (int) – Number of spaces to be used for indentation. By default 4.

    Return type:

      Generator[None, None, None]

  abstract out(*messages, **kwargs)

    Print messages without formatting.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract print(*messages, **kwargs)

    Print messages. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract ok(*messages, **kwargs)

    Print a success message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract fail(*messages, **kwargs)

    Print a failure message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract error(*messages, **kwargs)

    Print an error message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract warning(*messages, **kwargs)

    Print a warning message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract info(*messages, **kwargs)

    Print an info message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract bold_info(*messages, **kwargs)

    Print an info message with bold text. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  abstract download_progress(progress)

    Display a download progress

class pontos.terminal.NullTerminal

  A terminal implementation to keep the terminal quiet

  indent(indentation=4)

    A context manager for indenting output using spaces

    Example

        with terminal.indent():
            terminal.print("...")

    Parameters:

      indentation (int) – Number of spaces to be used for indentation. By default 4.

    Return type:

      Generator[None, None, None]

  out(*messages, **kwargs)

    Print messages without formatting.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  print(*messages, **kwargs)

    Print messages. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  ok(*messages, **kwargs)

    Print a success message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  fail(*messages, **kwargs)

    Print a failure message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  error(*messages, **kwargs)

    Print an error message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  warning(*messages, **kwargs)

    Print a warning message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  info(*messages, **kwargs)

    Print an info message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  bold_info(*messages, **kwargs)

    Print an info message with bold text. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  download_progress(progress)

    Display a download progress

class pontos.terminal.RichTerminal(file=None)

  A Terminal based on rich.

  Create a new RichTerminal

  Parameters:

    file (IO[str] | None) – A file object where the output should write to. Default is stdout.

  out(*messages, **kwargs)

    Print messages without formatting.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  print(*messages, **kwargs)

    Print messages. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  ok(*messages, **kwargs)

    Print a success message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  fail(*messages, **kwargs)

    Print a failure message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  error(*messages, **kwargs)

    Print an error message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  warning(*messages, **kwargs)

    Print a warning message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  info(*messages, **kwargs)

    Print an info message. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  bold_info(*messages, **kwargs)

    Print an info message with bold text. Possibly formatting is applied.

    Parameters:

      - *messages (Any) – Arguments to print.

      - **kwargs (Any) – Keyword arguments forwarded to the underlying implementation.

  download_progress(progress)

    Display a download progress