fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Convention for non-task functions?


From: Nick Welch
Subject: Re: [Fab-user] Convention for non-task functions?
Date: Wed, 22 Jul 2009 16:15:00 -0700

Awesome!  Thank you.

On Wed, Jul 22, 2009 at 4:08 PM, Jeff Forcier <address@hidden> wrote:
Hi Nick,

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.

As Xinan implied, you seem to be using Fabric 0.1.1. Fabric 0.9, which
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]