minos.cli.wizards.questions module
- class minos.cli.wizards.questions.Question(name, type_, help_=None, choices=None, default=None, secret=False, link=None)[source]
Bases:
objectQuestion class.
- ask(*args, **kwargs)[source]
Perform the ask.
- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
str- Returns
The obtained answer.
- classmethod from_raw(raw)[source]
Build a new instance from raw.
- Parameters
raw (
dict[str,typing.Any]) – A dictionary containing the question attributes.- Return type
- Returns
A new
Questioninstance.
- get_template_uri(answer, *args, **kwargs)[source]
Get template uri for the given answer.
- Parameters
answer (
typing.Any) – The answer value.- Return type
typing.Optional[str]- Returns
The template uri. It can be
Noneif the given response does not have any associated template.
- render_choices(*args, **kwargs)[source]
Render the choices value.
- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
typing.Union[list[typing.Any],dict[typing.Any],None]- Returns
A
strvalue.
- render_default(*args, **kwargs)[source]
Render the default value.
- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
typing.Any- Returns
A
strvalue.
- render_title(*args, **kwargs)[source]
Render the title value.
- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
str- Returns
A
strvalue.
- property title: str
Get the title text to be shown during the asking process.
- Return type
str- Returns
A
strvalue.