now.dialog module#
This module implements a command-line dialog with the user. Its goal is to configure a UserInput object with users specifications. Optionally, values can be passed from the command-line when jina-now is launched. In that case, the dialog won’t ask for the value.
- now.dialog.maybe_prompt_user(questions, attribute, **kwargs)[source]#
Checks the kwargs for the attribute name. If present, the value is returned directly. If not, the user is prompted via the cmd-line using the questions argument.
- Parameters
questions – A dictionary that is passed to PyInquirer.prompt See docs: https://github.com/CITGuru/PyInquirer#documentation
attribute – Name of the value to get. Make sure this matches the name in kwargs
- Returns
A single value of either from kwargs or the user cli input.