qwikstart.utils.prompt module¶
Input prompts to request data from users.
-
class
qwikstart.utils.prompt.PromptSpec(name: str, help_text: Optional[str] = None, default: Optional[Any] = None, choices: Optional[List[Any]] = None, input_type: Type[qwikstart.utils.input_types.InputType[Any]] = qwikstart.utils.input_types.StringInput, input_config: Dict[str, Any] = <factory>)¶ Bases:
objectData class used to specify input prompts.
-
choices: Optional[List[Any]] = None¶
-
default: Optional[Any] = None¶
-
help_text: Optional[str] = None¶
-
input_config: Dict[str, Any] = None¶
-
input_type¶
-
name: str = None¶
-
property
ptk_kwargs¶ Return keyword arguments for
prompt_toolkit.prompt.
-
-
qwikstart.utils.prompt.create_prompt_spec(**prompt_kwargs: Any) → qwikstart.utils.prompt.PromptSpec¶ Return PromptSpec instance from attributes in dictionary.
This raises a UserFacingError if the PromptSpec is incorrectly defined.
-
qwikstart.utils.prompt.get_param_type(**prompt_kwargs: Any) → Type[qwikstart.utils.input_types.InputType[Any]]¶
-
qwikstart.utils.prompt.read_user_choice(prompt_spec: qwikstart.utils.prompt.PromptSpec) → Any¶ Prompt user to choose from several options for the given variable.
The first item will be returned if no input provided.
Adapted from
cookiecutter.prompt(see https://github.com/cookiecutter/cookiecutter).
-
qwikstart.utils.prompt.read_user_variable(prompt_spec: qwikstart.utils.prompt.PromptSpec) → Any¶ Prompt user for variable and return the entered value or given default.
Adapted from
cookiecutter.prompt(see https://github.com/cookiecutter/cookiecutter).For more info, see https://click.palletsprojects.com/en/7.x/api/#click.prompt