Since I use a virtualenv on my servers, before I run "python zzz.py",
I need to activate the virtualenv.  So I'm doing this right now:

    run("source /home/matt/virtualenvs/foo/bin/activate && python zzz.py")

I read through how fabric.context_managers.cd works.  It seems to set
a key in the env dictionary.  Then in fabric.operations.run, that key
is interpolated into the string to be sent as a command.

It might be nice to have something like this:

with context_managers.prefixes(['source
/home/matt/virtualenv/foo/bin/activate', 'cd /home/matt/projects']):
    run('python zzz.py')

Thoughts?  I would have to change run to look in env.prefixes and glue
all that junk in.

Is there some much simpler way of activating a virtualenv before I run
each one of my commands?

Matt


-- 
Matthew Wilson
m...@tplus1.com
http://tplus1.com


_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to