Skip to content

present.out

err(*values, sep=None, end=None, flush=False)

Wrapper around print() that emits to an error in red

Source code in /home/runner/work/arc/arc/arc/present/out.py
def err(
    *values: object,
    sep: str | None = None,
    end: str | None = None,
    flush: bool = False,
) -> None:
    """Wrapper around `print()` that emits to an error in red"""
    _default_console().err(*values, sep=sep, end=end, flush=flush)

info(*values, sep=None, end=None, flush=False)

Wrapper around print() that emits to stderr instead of stdout

Source code in /home/runner/work/arc/arc/arc/present/out.py
def info(
    *values: object,
    sep: str | None = None,
    end: str | None = None,
    flush: bool = False,
) -> None:
    """Wrapper around `print()` that emits to `stderr` instead of `stdout`"""
    _default_console().info(*values, sep=sep, end=end, flush=flush)

log(*values, sep=None, end=None, file=None, flush=False)

print() to stderr with a timestamp

Source code in /home/runner/work/arc/arc/arc/present/out.py
def log(
    *values: object,
    sep: str | None = None,
    end: str | None = None,
    file: t.IO[str] | None = None,
    flush: bool = False,
) -> None:
    """`print()` to stderr with a timestamp"""
    _default_console().log(*values, sep=sep, end=end, file=file, flush=flush)

print(*values, sep=None, end=None, file=None, flush=False)

A wrapper around print() that handles removing escape codes when the output is not a TTY

Source code in /home/runner/work/arc/arc/arc/present/out.py
def print(
    *values: object,
    sep: str | None = None,
    end: str | None = None,
    file: t.IO[str] | None = None,
    flush: bool = False,
) -> None:
    """A wrapper around `print()` that handles removing escape
    codes when the output is not a TTY"""

    _default_console().print(*values, sep=sep, end=end, file=file, flush=flush)

usage(command)

Display the usage string for a given command object. Writes it to stderr

Source code in /home/runner/work/arc/arc/arc/present/out.py
def usage(command: Command) -> None:
    """Display the usage string for a given command object. Writes it to `stderr`"""
    info(command.doc.usage())