You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You all have created a great module and I really enjoy using it. Bravo!
However, I wish to add a validator to an input dialog, but, alas I'm and idiot and can't see to figure it out. I wish to not wrap it in a while loop. I see the Buffer class and assume it will be something having to do with that.
If we can figure it out together I will add it to examples and/or documentation. I think it would be valuable.
For my prompts I did this
validator=functools.partial(new_limit_validator, input_type=input_type, curr_lim=curr_lim, op=op)
validator=Validator.from_callable(validator,
error_message="New {0} limit must be {1} than {2}".format(name, op, curr_lim.humanized),
move_cursor_to_end=True)
new_limit_prompt=prompt(text="New {0} limit? format: {1}".format(name, fmt),
validator=validator,
validate_while_typing=False)
I have attempted instantiating a PromptSession object before hand to add my validator to but it isn't inherited by the dialog (makes sense).
Is there anyway I can do something similar with the dialog?
V/R
Vlad
The text was updated successfully, but these errors were encountered:
Hello prompt-toolkit team,
You all have created a great module and I really enjoy using it. Bravo!
However, I wish to add a validator to an input dialog, but, alas I'm and idiot and can't see to figure it out. I wish to not wrap it in a while loop. I see the
Buffer
class and assume it will be something having to do with that.If we can figure it out together I will add it to examples and/or documentation. I think it would be valuable.
For my prompts I did this
I have attempted instantiating a
PromptSession
object before hand to add my validator to but it isn't inherited by the dialog (makes sense).Is there anyway I can do something similar with the dialog?
V/R
Vlad
The text was updated successfully, but these errors were encountered: