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: object

Question class.

__init__(name, type_, help_=None, choices=None, default=None, secret=False, link=None)[source]
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

minos.cli.wizards.questions.Question

Returns

A new Question instance.

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 None if 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 str value.

render_default(*args, **kwargs)[source]

Render the default value.

Parameters
  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Return type

typing.Any

Returns

A str value.

render_title(*args, **kwargs)[source]

Render the title value.

Parameters
  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Return type

str

Returns

A str value.

property title: str

Get the title text to be shown during the asking process.

Return type

str

Returns

A str value.