[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Remaining issues (#8, #9, #10)
From: |
Jeff Forcier |
Subject: |
Re: [Fab-user] Remaining issues (#8, #9, #10) |
Date: |
Sat, 25 Oct 2008 17:31:42 -0400 |
On Sat, Oct 25, 2008 at 5:08 PM, Christian Vest Hansen
<address@hidden> wrote:
>>> == 10. "_protected" names are discarded ==
>>
>> Unless I'm missing something, this hasn't been touched, but you also
>> mentioned it's not pressing.
>
> I have not touched it, but it would definitely be nice to have.
Honestly, I'd be all for updating the logic like so:
for name, obj in captured.items():
if not name.startswith('_') and isinstance(obj, types.FunctionType):
COMMANDS[name] = obj
else:
__builtins__[name] = obj
In other words, non-underscored functions become commands, and
_everything_ else -- underscored functions, regular nonfunctions, and
underscored nonfunctions -- gets tossed into the local namespace.
If Niklas makes those changes to how fabfile state is stored, it may
make some of this moot anyways, but as a general algorithm for
stuff_in_your_fabfile => stuff_available_inside_commands I think it's
probably the best way to go. Having a more robust state mechanism may
also make it easier to deal with any problems in underscored methods
(such as shadowing existing helper methods and so forth).
-Jeff