lib/python: lazily load the extremely slow virtualenvwrapper

This commit is contained in:
Steve Losh 2010-08-12 09:20:12 -04:00
commit f2dad51a2c

View file

@ -1,5 +1,7 @@
function wo() { function wo() {
[ -f './.venv' ] && workon `cat ./.venv` [ "$VEW_SOURCED" ] || source "$VEW_PATH"
[ -f './.venv' ] && workon `cat ./.venv` || workon $1
export VEW_SOURCED=1
} }
alias deact='deactivate' alias deact='deactivate'
alias cdv='cd $WORKON_HOME' alias cdv='cd $WORKON_HOME'
@ -8,4 +10,4 @@ function cdp () {
cd "$(python -c "import os.path as _, ${1}; \ cd "$(python -c "import os.path as _, ${1}; \
print _.dirname(_.realpath(${1}.__file__[:-1]))" print _.dirname(_.realpath(${1}.__file__[:-1]))"
)" )"
} }