ipython/ipython — pull request #1548 by minrk (2012-04-04 02:47:04+00:00)
Title: add sugar methods/properties to AsyncResult

* `ar.wall_time` = received - submitted
* `ar.serial_time` = sum of serial computation time
* `ar.elapsed` = time since submission (wall_time if done)
* `ar.progress` = (int) number of sub-tasks that have completed
* `len(ar)` = # of tasks
* `ar.wait_interactive()`: prints progress

These are simple methods derived from the metadata/timestamps already created. But I've been persuaded by @wesm's practice of including simple methods that do useful (and/or cool) things.

This also required/revealed some minor fixes/cleanup to clear_output in some cases:

* dedent base `core.displaypub.clear_output`, so it's actually defined in the class
* clear_output publishes `'\r\b'`, so it will clear terminal-like frontends that don't understand full clear_output behavior.
* `core.display.clear_output()` still works, even outside an IPython session.