hermes.commands.init.slim_click
Slim, self-made version of click so we don’t need to use it for simple console questions.
Attributes
If this is true, echo() will print texts with debug=True. |
|
If true links will be hidden in the console. Not all consoles support this however. |
Classes
Generic enumeration. |
Functions
|
|
|
|
|
The user gets to decide between yes (y) and no (n). The answer will be returned as bool. |
|
Returns the user's response to the given text. It is just a wrapper for input(). |
|
|
|
The user gets to make a choice between predefined answers. |
|
|
|
|
|
Use this to have a consistent display of hyperlinks. |
Module Contents
- hermes.commands.init.slim_click.PRINT_DEBUG = False
If this is true, echo() will print texts with debug=True.
- class hermes.commands.init.slim_click.Formats
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- hermes.commands.init.slim_click.echo(text: str, debug: bool = False, formatting: Formats = Formats.EMPTY)
- Parameters:
text – The printed text.
debug – If debug, the text will only be printed when slim_click.PRINT_DEBUG is true.
formatting – You can use the Formats Enum to give the text a special color or formatting.
- hermes.commands.init.slim_click.confirm(text: str, default: bool = True) bool
The user gets to decide between yes (y) and no (n). The answer will be returned as bool.
- hermes.commands.init.slim_click.answer(text: str) str
Returns the user’s response to the given text. It is just a wrapper for input().
- hermes.commands.init.slim_click.choose(text: str, options: list[str], default: int = 0) int
The user gets to make a choice between predefined answers.
- Parameters:
text – Displayed text / question
options – List with possible answers
default – Selected answer (index) if the user doesn’t enter anything
- Returns:
The index of the selected option