8989# existing builtin commands. We need to use a builtin for cd because
9090# we are trying to change the state of the current shell, so we use
9191# "builtin" for bash and zsh but "command" under ksh.
92- function __virtualenvwrapper_cd {
93- if [ -n " $BASH " ]
94- then
95- builtin \c d " $@ "
96- elif [ -n " $ZSH_VERSION " ]
97- then
98- builtin \c d " $@ "
99- else
100- command \c d " $@ "
101- fi
92+ function virtualenvwrapper_cd {
93+ if [ -n " $BASH " ]
94+ then
95+ builtin \c d " $@ "
96+ elif [ -n " $ZSH_VERSION " ]
97+ then
98+ builtin \c d " $@ "
99+ else
100+ command \c d " $@ "
101+ fi
102102}
103103
104104function virtualenvwrapper_expandpath {
105- if [ " $1 " = " " ]; then
106- return 1
107- else
108- " $VIRTUALENVWRAPPER_PYTHON " -c " import os,sys; sys.stdout.write(os.path.normpath(os.path.expanduser(os.path.expandvars(\" $1 \" )))+'\n')"
109- return 0
110- fi
105+ if [ " $1 " = " " ]; then
106+ return 1
107+ else
108+ " $VIRTUALENVWRAPPER_PYTHON " -c " import os,sys; sys.stdout.write(os.path.normpath(os.path.expanduser(os.path.expandvars(\" $1 \" )))+'\n')"
109+ return 0
110+ fi
111111}
112112
113113function virtualenvwrapper_derive_workon_home {
@@ -166,8 +166,8 @@ function virtualenvwrapper_verify_workon_home {
166166
167167# Function to wrap mktemp so tests can replace it for error condition
168168# testing.
169- function __virtualenvwrapper_mktemp {
170- command \m ktemp " $@ "
169+ function virtualenvwrapper_mktemp {
170+ command \m ktemp " $@ "
171171}
172172
173173# Expects 1 argument, the suffix for the new file.
@@ -176,7 +176,7 @@ function virtualenvwrapper_tempfile {
176176 typeset suffix=${1:- hook}
177177 typeset file
178178
179- file=" $( __virtualenvwrapper_mktemp -t virtualenvwrapper-$suffix -XXXXXXXXXX) "
179+ file=" $( virtualenvwrapper_mktemp -t virtualenvwrapper-$suffix -XXXXXXXXXX) "
180180 if [ $? -ne 0 ] || [ -z " $file " ] || [ ! -f " $file " ]
181181 then
182182 echo " ERROR: virtualenvwrapper could not create a temporary file name." 1>&2
@@ -212,8 +212,8 @@ function virtualenvwrapper_run_hook {
212212 fi
213213 # cat "$hook_script"
214214 source " $hook_script "
215- elif [ " ${1} " = " initialize" ]
216- then
215+ elif [ " ${1} " = " initialize" ]
216+ then
217217 cat - 1>&2 << EOF
218218virtualenvwrapper.sh: There was a problem running the initialization hooks.
219219
@@ -424,7 +424,7 @@ function mkvirtualenv {
424424 virtualenvwrapper_verify_virtualenv || return 1
425425 (
426426 [ -n " $ZSH_VERSION " ] && setopt SH_WORD_SPLIT
427- __virtualenvwrapper_cd " $WORKON_HOME " &&
427+ virtualenvwrapper_cd " $WORKON_HOME " &&
428428 " $VIRTUALENVWRAPPER_VIRTUALENV " $VIRTUALENVWRAPPER_VIRTUALENV_ARGS " $@ " &&
429429 [ -d " $WORKON_HOME /$envname " ] && \
430430 virtualenvwrapper_run_hook " pre_mkvirtualenv" " $envname "
@@ -485,7 +485,7 @@ function rmvirtualenv {
485485 # Move out of the current directory to one known to be
486486 # safe, in case we are inside the environment somewhere.
487487 typeset prior_dir=" $( pwd) "
488- __virtualenvwrapper_cd " $WORKON_HOME "
488+ virtualenvwrapper_cd " $WORKON_HOME "
489489
490490 virtualenvwrapper_run_hook " pre_rmvirtualenv" " $env_name "
491491 command \r m -rf " $env_dir "
@@ -494,7 +494,7 @@ function rmvirtualenv {
494494 # If the directory we used to be in still exists, move back to it.
495495 if [ -d " $prior_dir " ]
496496 then
497- __virtualenvwrapper_cd " $prior_dir "
497+ virtualenvwrapper_cd " $prior_dir "
498498 fi
499499 done
500500}
@@ -505,7 +505,7 @@ function virtualenvwrapper_show_workon_options {
505505 # NOTE: DO NOT use ls here because colorized versions spew control characters
506506 # into the output list.
507507 # echo seems a little faster than find, even with -depth 3.
508- (__virtualenvwrapper_cd " $WORKON_HOME " ; for f in * /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate; do echo $f ; done) 2> /dev/null | command \s ed ' s|^\./||' | command \s ed " s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate||" | command \s ort | (unset GREP_OPTIONS; command \e grep -v ' ^\*$' )
508+ (virtualenvwrapper_cd " $WORKON_HOME " ; for f in * /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate; do echo $f ; done) 2> /dev/null | command \s ed ' s|^\./||' | command \s ed " s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate||" | command \s ort | (unset GREP_OPTIONS; command \e grep -v ' ^\*$' )
509509}
510510
511511function _lsvirtualenv_usage {
@@ -752,14 +752,14 @@ function cdsitepackages {
752752 virtualenvwrapper_verify_workon_home || return 1
753753 virtualenvwrapper_verify_active_environment || return 1
754754 typeset site_packages=" ` virtualenvwrapper_get_site_packages_dir` "
755- __virtualenvwrapper_cd " $site_packages " /$1
755+ virtualenvwrapper_cd " $site_packages " /$1
756756}
757757
758758# Does a ``cd`` to the root of the currently-active virtualenv.
759759function cdvirtualenv {
760760 virtualenvwrapper_verify_workon_home || return 1
761761 virtualenvwrapper_verify_active_environment || return 1
762- __virtualenvwrapper_cd $VIRTUAL_ENV /$1
762+ virtualenvwrapper_cd $VIRTUAL_ENV /$1
763763}
764764
765765# Shows the content of the site-packages directory of the currently-active
@@ -847,7 +847,7 @@ function cpvirtualenv {
847847 echo " Copying $src_name as $trg_name ..."
848848 (
849849 [ -n " $ZSH_VERSION " ] && setopt SH_WORD_SPLIT
850- __virtualenvwrapper_cd " $WORKON_HOME " &&
850+ virtualenvwrapper_cd " $WORKON_HOME " &&
851851 " $VIRTUALENVWRAPPER_VIRTUALENV_CLONE " " $src " " $trg "
852852 [ -d " $trg " ] &&
853853 virtualenvwrapper_run_hook " pre_cpvirtualenv" " $src " " $trg_name " &&
0 commit comments