PyInquirer
PyInquirer copied to clipboard
Message function definition not working
Thank you for this! It's a lot of fun to work with! I tried creating a function for the message to return a string but functions for message doesn't seem to be working (even though docs say otherwise).
def _confirm_options(answers):
message = "Confirm choices: " + str(answers)
return message
group_choices = [
{
"type": "input",
"name": "group_id",
"message": "Enter id of parent group",
},
{
"type": "input",
"name": "group_name",
"message": "Enter desired group name"},
{
"type": "confirm",
"name": "confirm",
"message": _confirm_options,
"default": True,
},
]
result is this: ? <function
I'm running into the same issue - any light you can shed?
It looks like there's no check whether the value of messages
is callable and subsequent call. By contrast, contrast
is documented similarly but the function is actually called. There is no similar code for messages
in the codebase. Duplicating this code and replacing all mentions of choices
with messages
would fix this.
Just ran into the same issue. Thanks @elyscape for showing the solution. It took about a minute to fix -- now the hard part is just getting it pulled in lol. In the meanwhile, I'm using my own branch as a local package.
Any progress on this getting pulled in? Ran into it as well and it would be nice not to have maintain my own fork...
Any progress on this getting pulled in? Ran into it as well and it would be nice not to have maintain my own fork...
This project appears to be no longer active.