prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.11k stars 717 forks source link

Document is_done filter #820

Open techtonik opened 5 years ago

techtonik commented 5 years ago

What does is_done do? Here:

https://github.com/prompt-toolkit/python-prompt-toolkit/blob/4c3ca92c7a5f09711e12a89be2c2cfd3fe5c8355/prompt_toolkit/shortcuts/prompt.py#L489-L491

jonathanslenders commented 5 years ago

It will become true when an exit value for the application has been set. In the case of a REPL, it is for instance used when the user presses ENTER, and the return value is set. At that point, the toolbars (if there are any) should not be displayed anymore.

EDIT: The tilde before the is_done is a negation. It means, display the toolbar if we're not done yet.