fabric/fabric — Issue #505: Context manager for wrapping verbose operations
Author: bitprophet
Created: 2011-12-18 04:44:10+00:00
State: open

I've implemented this at the fabfile level a few times now and it would be nice to have in core/contrib.

The idea is to hide the output of chunks of code and to instead just print a simple status line, finishing off with "done" at the end. (Obviously this could be extended in future with spinners, progress bars, etc, which would be strongly tied to #363.)

E.g.:

```python
@task
def do_verbose_crap():
run("echo 'blah'")
with msg("Working"):
run("echo \"This hides e.g. 'running' and 'stdout' but not 'stderr' or 'warnings'\"")
sudo("More crap here")
run("echo 'blah2'")
```

Output would be:

```
[hostname] run: echo 'blah'
[hostname] out: blah
[hostname] Working... done.
[hostname] run: echo 'blah2'
[hostname] out: blah2
```