
Notes on Python Fabric 0.9b1 - twampss
http://www.saltycrane.com/blog/2009/10/notes-python-fabric-09b1/
======
nocivus
Lol, I just noticed you also posted something on fabric. If I seen it I would
not have submitted another entry.

One quick note. I think it's a good idea to explain that, since from the
command line you are basically calling functions inside the fabfile.py, this
allows you to define different environments. Something like:

def env1(): env.some_property = 'hehe'

def env2(): env.some_property = 'haha'

def deploy(): put('/%s/file.prop', '/somewhere_in_the_server/')

If you then run 'fab env1 deploy' you will copy the file under 'hehe' to the
server. If you use env2 you will copy the other one. You are basically
overriding the env variable. You can do the same to configure different paths
for different target servers.

Really cool stuff :D

~~~
nocivus
Is there a way that code could be formatted? :)

~~~
mattyb
Precede the code with a blank line and then two spaces.

    
    
      $str = 'Like this.';
      echo $str;
    

<http://news.ycombinator.com/formatdoc>

