minos.cli.wizards.forms module
- class minos.cli.wizards.forms.Form(questions)[source]
Bases:
object
Form class.
- ask(context=None, **kwargs)[source]
Perform the asking process.
- Parameters
context (
typing.Optional
[dict
[str
,typing.Any
]]) – A mapping containing already answered questions and environment variables for rendering.kwargs – Additional named arguments to be passed to each question.
- Return type
dict
[str
,typing.Any
]- Returns
A mapping from the question names to the obtained answers.
- classmethod from_raw(raw)[source]
Build a new instance from raw.
- Parameters
raw (
dict
[str
,typing.Any
]) – A dictionary containing the form attributes.- Return type
- Returns
A new
Form
instance.
- get_template_uris(answers, context=None, *args, **kwargs)[source]
Get template uris.
- Parameters
answers (
dict
[str
,typing.Any
]) – A mapping from question name to answer value.context (
typing.Optional
[dict
[str
,typing.Any
]]) – Additional context variables.args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
list
[str
]- Returns
A list of strings representing template uris.
- property links: list[str]
Get the list of question names that are links to another templates.
- Return type
list
[str
]- Returns
A list of
str
values.