|
From: | Corry Haines |
Subject: | Re: [Fab-user] Possible issue stacking decorators |
Date: | Thu, 14 Jul 2011 17:45:12 -0700 |
Hi Corry,
Well, decorators in general always have an "order matters" behavior,
On Thu, Jul 14, 2011 at 3:50 PM, Corry Haines <address@hidden> wrote:
> I have some fab files that stack decorators, and while trying theĀ name
> spacingĀ feature, I seem to have hit an odd issue.
> Below are some example files, but the basic issue is that some decorators do
> not seem to stack (and order matters).
unfortunately -- since they are not guaranteed to always return the
function they were given.
This is the case with @task -- it wraps the function in a richer task class.
So, it does need to come first/at the top of the list of decorators.
We should probably add this to the docs so it's explicitly obvious.
Please let us know if that doesn't answer the question -- since *most*
of the other decorators don't care about the ordering (other Fab
decorators simply tack attributes onto the functions and return them)
it shouldn't be a problem, per se, to always stick @task at the top.
Best,
Jeff
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org
[Prev in Thread] | Current Thread | [Next in Thread] |