peal.global_utils.request

peal.global_utils.request(name, default, is_asking=True)[source]

Ask on the console whether a value should be changed.

Used by the interactive config scripts. Booleans are simply negated when the answer is yes, lists are read back as a comma separated string, and everything else is read as free text (so the return type is str).

Parameters:
  • name (str) – Name shown in the prompt.

  • default (object) – Current value, returned when the answer is "n".

  • is_asking (bool, optional) – False returns the default without prompting, which makes the scripts usable non-interactively.

Returns:

The default or the value entered by the user.

Return type:

object