dotcloud/docker-py — pull request #140 by aanand (2014-01-14 17:25:21+00:00)
Title: Sensible url handling

Now that the Docker client supports setting the daemon URL via the `DOCKER_HOST` environment variable, it'd be nice to be able to get the same behaviour from docker-py. I'm a bit wary of libraries that configure themselves using magic globals, so I haven't baked in direct reading of `os.environ`, but next best thing:

```python
import os
from docker import Client
client = Client(os.environ.get('DOCKER_HOST'))
```

I think that's a good application of "explicit is better than implicit".

The actual changes I've made:

- `tcp://` urls are converted to `http://`
- `None` is converted to `unix://var/run/docker.sock`