GoogleCloudPlatform/gcloud-python — pull request #48 by jgeewax (2014-02-24 01:01:31+00:00)
Title: Added DemoRunner and cleaned up demo scripts.

This fixes the issue opened a while ago about generalizing demo scripts:

1. We want the demo script to be easy to read in a browser, so ideally it should look like a regular Python script with comments describing what's happening.
1. We want `python -m gcloud..demo` to run the demo interactively (type out code, print out comments, enter to move onto the next step, etc)
1. The demo module should expose a connection/dataset/etc to the playground code (ie, `from gcloud. import demo` and `connection = demo.get_connection()` should work)

This change does that, it's a bit short on comments and docstrings... It also takes into account indented blocks (this was necessary for the `with dataset.transaction() as t:` blocks)

CC: @proppy