[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] %(my_var)s or $(my_var)
From: |
Loic d'Anterroches |
Subject: |
Re: [Fab-user] %(my_var)s or $(my_var) |
Date: |
Sun, 04 May 2008 13:33:37 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080227) |
Hi Christian,
> The difference is the evaluation time. The %(...)s notation is
> evaluated as soon as possible, whereas the $() notation is lazily
> evaluated.
>
> This example illustrates the difference:
>
> def test():
> set(var = 'a')
> set(cmd = 'echo %(var)s $(var)')
> set(var = 'b')
> local(get('cmd'))
>
> If you run that as a command with fabric, it will print "a b".
>
> The drawback with the lazy notation is that you can't apply any
> formatting rules to it, but you hardly ever need to do that in a
> fabrfile anyway so I don't think it's a big issue.
Thanks! This is exactly what I needed to know.
Best regards,
loïc
> On 5/4/08, Loic d'Anterroches <address@hidden> wrote:
>> Hi Christian,
>>
>> I am slowly starting to standardize all my deployment scripts to use fab
>> with a standard set of commands. That way I can do:
>>
>> $ cd ~/Websites/my.website.com
>> $ fab prod build deploy
>>
>> or simply do that in all the folders in ~/Websites to update all my
>> websites in one go.
>>
>> It is working great, but I have a small question:
>> What is the difference between %(my_var)s and $(my_var) in the commands?
>> Do they have different way to be interpolated?
>>
>> Best regards,
>> loïc
>>
>> Note: Great idea the website, you should also link to your relevent blog
>> posts.
>>
>> --
>> Pluf PHP5 Framework inspired by Django
>> http://www.pluf.org
>>
>>
>>
>>
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>
>