fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Completed suggestions: load and config (#1, #2, #3)


From: Niklas Lindström
Subject: Re: [Fab-user] Completed suggestions: load and config (#1, #2, #3)
Date: Thu, 23 Oct 2008 18:12:52 +0200

Hm, I don't think so..

While that name "config" can be used explicitly by looking in COMMANDS
(which makes it work when supplied to "fab"), it will then shadow the
"config" (see `_new_namespace`), since "config" and all commands,
operators and decorators share the same namespace. Unless you add
"config" in the namespace after the rest, but that feels brittle..

The easy way is to call it e.g. "configure". ;)

---- [here I go again] ----

One thought that struck me though, is if (some of) the builtin
commands should be command line options (using the excellent stdlib
module `optparse` makes it easy)? While the current way is uniform, I
think of "help", "list", "set" etc. as "metacommands" who aren't
really the same thing as user-defined commands IMHO.

Going that route (e.g. "-h/--help", "-c/--help-command <cmdname>",
"-l/--list"), this could be named "-c/--config <a=1,b=2>"..

-------

But that's a suggestion in its own right (if you like it I can
formalize it), so I suggest "configure" for the command name.

Best regards,
Niklas



On Thu, Oct 23, 2008 at 5:45 PM, Christian Vest Hansen
<address@hidden> wrote:
> On Wed, Oct 22, 2008 at 12:09 AM, Niklas Lindström <address@hidden> wrote:
>> [These changes are present in my fork of Fabric at
>> <http://github.com/niklasl/fabric/tree/master>]
>>
>>
>> == 1. Load once ==
>>
>> Only run `load` once per filename. Uses `_LOADED_FABFILES`.
>>
>>
>> == 2. Load with namespaces ==
>>
>> `load` takes a managed namespace as globals, composed of the items in
>> COMMANDS, OPERATIONS, DECORATORS and the new `config` object (see
>> `_new_namespace`).
>>
>> Note: as per Christian's advice, I've run:
>>
>>    $ cd prototypes/; fab test_imports test_global_assignment
>>
>> which printed "all double-good". So I think Christian is happy about it. :)
>>
>>
>> == 3. A config object instead of get/set ==
>>
>> The object `config` has been added as a suggested replacement for the
>> `get` and `set` operators. It is actually a reference to `ENV`, which
>> is now an instance of `Configuration`. (See also `_new_namespace` from
>> Change #2.)
>>
>> Note: I initially named this `var`, but it looked to cryptic in my opinion.
>>
>> Suggestion: Christian suggested `let`, but I've kept `config` so far..
>>
>> Suggestion: if this is accepted, I propose to remove the current `get`
>> and `set` operations (and rename the `set` command).
>
> Would you name the command `config` as well?
>
>>
>>
>> ------------------------------------------
>> Best regards,
>> Niklas
>>
>>
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>
>
>
> --
> Venlig hilsen / Kind regards,
> Christian Vest Hansen.
>




reply via email to

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