fabric/fabric — pull request #1021 by davidhalter (2013-11-12 15:08:27+00:00)
Title: Custom interactive prompts

improves and fixes #741. might fix #171 (not sure though) and probably also helps with #7 (also I don't know if that one is really fully solvable).

There's an implementation difference. The `env` variable is not named `prompt_responses` anymore but `prompts`, because I think it's shorter and a better fit.

For the future we could think about two things:
- Currently the dictionary allows only for strings, I think it would be interesting to allow compiled regex objects, should not be hard to implement.
- @owenn used a small hack to shorten

And also I would like to see tox in fabric. It makes testing (especially the setting up part) way easier (if you haven't heard of it: it eases testing against multiple python versions).

Now you can do something like:
```
with settings(prompts={"remove write-protected regular file `/etc/fuse.conf'? ": "yes"}):
run('rm -i /etc/fuse.conf')
```

Not that this example makes sense, but it shows the use case well: interactive prompts.