Terminal utilities¶
Utilities for logging and asking for user input.
Logging¶
- roastery.term.log(*contents: str, style: str | None = None, header: str | None = None)[source]¶
Log contents to the terminal in a given style.
- roastery.term.info(*contents: str)[source]¶
Log the contents to the terminal in informational style.
- Parameters:
contents (str) – String containing the log message in Rich Markup.
- roastery.term.error(*contents: str)[source]¶
Log the contents to the terminal as an error.
- Parameters:
contents (str) – String containing the log message in Rich Markup.
- roastery.term.warn(*contents: str)[source]¶
Log the contents to the terminal as a warning.
- Parameters:
contents (str) – String containing the log message in Rich Markup.
User input¶
- roastery.term.ask(question: str, *, default: str = None) str [source]¶
Ask the user a question, returning their answer.
Users will be able to enter their answer in a readline-style environment with vi-style keybindings.