I guess I was thinking auto-connect.  Is there a good argument to not have
it auto-connect?  (Perhaps some settings on the object need to be tweaked
before connecting?)  If so, maybe this would be clearer:

```
c = SAMPClient(...)
with c.connect():
    ...
```


On Mon, Jan 20, 2014 at 4:43 AM, Thomas Robitaille <notifications@github.com
> wrote:

> In docs/vo/samp/example_table_image.rst:
>
> > +Success! The table URL should now be available in ``r.params['url']``, so we can do::
> > +
> > +    >>> from astropy.table import Table
> > +    >>> t = Table.read(r.params['url'])
> > +    Downloading http://127.0.0.1:2525/dynamic/4/t12.vot [Done]
> > +    >>> t
> > +               col1             col2     col3    col4     col5    col6 col7  col8 col9 col10
> > +    ------------------------- -------- ------- -------- -------- ----- ---- ----- ---- -----
> > +    SSTGLMC G000.0046+01.1431   0.0046  1.1432 265.2992 -28.3321  6.67 5.04  6.89 5.22     N
> > +    SSTGLMC G000.0106-00.7315   0.0106 -0.7314 267.1274 -29.3063  7.18 6.07   nan 5.17     Y
> > +    SSTGLMC G000.0110-01.0237   0.0110 -1.0236 267.4151 -29.4564  8.32 6.30  8.34 6.32     N
> > +    ...
> > +
> > +As before, we should remember to disconnect from the hub once we are done::
> > +
> > +    >>> client.disconnect()
>
> At the moment, the way I've implemented it, one can do:
>
> with SAMPClient(...) as c:
>     c.connect()
>
> and it will automatically disconnect upon exiting. However, are you
> suggesting that it should also auto-connect?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/astropy/astropy/pull/1907/files#r8999865>
> .
>



-- 
|\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
|  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

http://www.droettboom.com/