On Wed, Mar 2, 2011 at 5:17 PM, Travis Swicegood <tra...@domain51.com>wrote:

> Doh - this went directly to Roy, not the entire list.  Here it is for
> anyone who's interested...
>
> ---------- Forwarded message ----------
> From: Travis Swicegood <tra...@domain51.com>
> Date: Wed, Mar 2, 2011 at 5:16 PM
> Subject: Re: [Fab-user] Best way of making proposals for Fabric?
> To: Rory Campbell-Lange <r...@campbell-lange.net>
>
>
> On Wed, Mar 2, 2011 at 1:41 PM, Rory Campbell-Lange <
> r...@campbell-lange.net> wrote:
>
>> 3. setup and teardown
>>
>
> Just as a thought, have you considered moving the logic into decorators?
>  They essentially provide setup/teardown functionality in that you can
> controll when the decorated function is executed.  That leads to very
> readable code:
>
>     @ssh_tunnel(source, destination)
>     def my_awesomeness():
>         # some really awesome task code
>
> Doesn't change that it'd be cool for tunneling to be exposed inside Fabric.
>  Maybe it should be a decorator.
>
> -T
>
>
>
Might also be good candidate for a  context manager:

    with ssh_tunnel(params):
        ...do stuff...

Kevin Horn
_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to