|
From: | Nick Welch |
Subject: | Re: [Fab-user] Convention for non-task functions? |
Date: | Wed, 22 Jul 2009 16:15:00 -0700 |
Hi Nick,
As Xinan implied, you seem to be using Fabric 0.1.1. Fabric 0.9, which
On Wed, Jul 22, 2009 at 12:54 AM, Nick Welch<address@hidden> wrote:
> I have some utility functions in my fabfile that get used by various
> tasks. The problem is that they're also interpreted as tasks and
> clutter up 'fab list'. I tried naming them with a leading underscore,
> but then I get a NameError claiming that the functions don't even exist.
is currently in beta but should be quite usable, has fairly Pythonic
rules about what gets loaded: anything not prefixed with an
underscore, and not defined in Fabric itself, is considered a task and
will be shown in "fab --list".
This is not fully laid out yet in the 0.9 docs, but will be before
final release.
Regarding Fab 0.1.1, while I don't have its execution model in my head
any longer (Christian may, if he's listening) a quick examination of
the source implies that yes, it was an all-or-nothing affair.
Underscored functions were omitted from the task list, but were *also*
not added to the __builtins__ used to execute the tasks themselves,
thus your current problem.
Again, I highly suggest upgrading to 0.9, especially if you're just
getting started. The documentation is a bit spare example-wise but
this will improve over the next couple of weeks, and we'll be here to
help out if you get stuck :)
Best,
Jeff
[Prev in Thread] | Current Thread | [Next in Thread] |