@@ -61,7 +61,7 @@ VIRTUALENVWRAPPER_ENV_BIN_DIR="bin"
61
61
if [ " $OS " = " Windows_NT" ] && [ " $MSYSTEM " = " MINGW32" ]
62
62
then
63
63
# Only assign this for msys, cygwin use standard Unix paths
64
- # and its own python installation
64
+ # and its own python installation
65
65
VIRTUALENVWRAPPER_ENV_BIN_DIR=" Scripts"
66
66
fi
67
67
@@ -156,7 +156,7 @@ function virtualenvwrapper_run_hook {
156
156
fi
157
157
" $VIRTUALENVWRAPPER_PYTHON " -c ' from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script " $hook_script " " $@ "
158
158
result=$?
159
-
159
+
160
160
if [ $result -eq 0 ]
161
161
then
162
162
if [ ! -f " $hook_script " ]
@@ -171,7 +171,7 @@ function virtualenvwrapper_run_hook {
171
171
return $result
172
172
}
173
173
174
- # Set up tab completion. (Adapted from Arthur Koziel's version at
174
+ # Set up tab completion. (Adapted from Arthur Koziel's version at
175
175
# http://arthurkoziel.com/2008/10/11/virtualenvwrapper-bash-completion/)
176
176
function virtualenvwrapper_setup_tab_completion {
177
177
if [ -n " $BASH " ] ; then
@@ -203,7 +203,7 @@ function virtualenvwrapper_setup_tab_completion {
203
203
_cdsitepackages_complete () {
204
204
reply=( $( cdsitepackages && ls -d ${1} * ) )
205
205
}
206
- compctl -K _virtualenvs workon rmvirtualenv cpvirtualenv showvirtualenv
206
+ compctl -K _virtualenvs workon rmvirtualenv cpvirtualenv showvirtualenv
207
207
compctl -K _cdvirtualenv_complete cdvirtualenv
208
208
compctl -K _cdsitepackages_complete cdsitepackages
209
209
fi
@@ -452,9 +452,9 @@ function _lsvirtualenv_usage {
452
452
#
453
453
# Usage: lsvirtualenv [-l]
454
454
function lsvirtualenv {
455
-
455
+
456
456
typeset long_mode=true
457
- if command -v " getopts" & > /dev/null
457
+ if command -v " getopts" & > /dev/null
458
458
then
459
459
# Use getopts when possible
460
460
OPTIND=1
@@ -535,14 +535,14 @@ function workon {
535
535
536
536
virtualenvwrapper_verify_workon_home || return 1
537
537
virtualenvwrapper_verify_workon_environment $env_name || return 1
538
-
538
+
539
539
activate=" $WORKON_HOME /$env_name /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate"
540
540
if [ ! -f " $activate " ]
541
541
then
542
542
echo " ERROR: Environment '$WORKON_HOME /$env_name ' does not contain an activate script." >&2
543
543
return 1
544
544
fi
545
-
545
+
546
546
# Deactivate any current environment "destructively"
547
547
# before switching so we use our override function,
548
548
# if it exists.
@@ -554,9 +554,9 @@ function workon {
554
554
fi
555
555
556
556
virtualenvwrapper_run_hook " pre_activate" " $env_name "
557
-
557
+
558
558
source " $activate "
559
-
559
+
560
560
# Save the deactivate function from virtualenv under a different name
561
561
virtualenvwrapper_original_deactivate=` typeset -f deactivate | sed ' s/deactivate/virtualenv_deactivate/g' `
562
562
eval " $virtualenvwrapper_original_deactivate "
@@ -568,10 +568,10 @@ function workon {
568
568
# Call the local hook before the global so we can undo
569
569
# any settings made by the local postactivate first.
570
570
virtualenvwrapper_run_hook "pre_deactivate"
571
-
571
+
572
572
env_postdeactivate_hook="$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postdeactivate"
573
573
old_env=$(basename "$VIRTUAL_ENV")
574
-
574
+
575
575
# Call the original function.
576
576
virtualenv_deactivate $1
577
577
@@ -585,9 +585,9 @@ function workon {
585
585
fi
586
586
587
587
}'
588
-
588
+
589
589
virtualenvwrapper_run_hook " post_activate"
590
-
590
+
591
591
return 0
592
592
}
593
593
@@ -603,7 +603,7 @@ function virtualenvwrapper_get_python_version {
603
603
604
604
# Prints the path to the site-packages directory for the current environment.
605
605
function virtualenvwrapper_get_site_packages_dir {
606
- echo " $VIRTUAL_ENV /lib/python` virtualenvwrapper_get_python_version` /site-packages"
606
+ echo " $VIRTUAL_ENV /lib/python` virtualenvwrapper_get_python_version` /site-packages"
607
607
}
608
608
609
609
# Path management for packages outside of the virtual env.
@@ -620,15 +620,15 @@ function virtualenvwrapper_get_site_packages_dir {
620
620
function add2virtualenv {
621
621
virtualenvwrapper_verify_workon_home || return 1
622
622
virtualenvwrapper_verify_active_environment || return 1
623
-
623
+
624
624
site_packages=" ` virtualenvwrapper_get_site_packages_dir` "
625
-
625
+
626
626
if [ ! -d " ${site_packages} " ]
627
627
then
628
628
echo " ERROR: currently-active virtualenv does not appear to have a site-packages directory" >&2
629
629
return 1
630
630
fi
631
-
631
+
632
632
# Prefix with _ to ensure we are loaded as early as possible,
633
633
# and at least before easy_install.pth.
634
634
path_file=" $site_packages /_virtualenv_path_extensions.pth"
@@ -702,7 +702,7 @@ function lssitepackages {
702
702
virtualenvwrapper_verify_active_environment || return 1
703
703
typeset site_packages=" ` virtualenvwrapper_get_site_packages_dir` "
704
704
ls $@ $site_packages
705
-
705
+
706
706
path_file=" $site_packages /_virtualenv_path_extensions.pth"
707
707
if [ -f " $path_file " ]
708
708
then
@@ -749,7 +749,7 @@ function cpvirtualenv {
749
749
fi
750
750
typeset source_env=" $env_home$env_name "
751
751
typeset target_env=" $env_home$new_env "
752
-
752
+
753
753
if [ ! -e " $source_env " ]
754
754
then
755
755
echo " $env_name virtualenv doesn't exist"
@@ -768,7 +768,7 @@ function cpvirtualenv {
768
768
" $VIRTUALENVWRAPPER_VIRTUALENV " " $target_env " --relocatable
769
769
\s ed " s/VIRTUAL_ENV\(.*\)$env_name /VIRTUAL_ENV\1$new_env /g" < " $source_env /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate" > " $target_env /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate"
770
770
771
- (\c d " $WORKON_HOME " && (
771
+ (\c d " $WORKON_HOME " && (
772
772
virtualenvwrapper_run_hook " pre_cpvirtualenv" " $env_name " " $new_env " ;
773
773
virtualenvwrapper_run_hook " pre_mkvirtualenv" " $new_env "
774
774
))
@@ -797,7 +797,7 @@ function virtualenvwrapper_verify_project_home {
797
797
}
798
798
799
799
# Given a virtualenv directory and a project directory,
800
- # set the virtualenv up to be associated with the
800
+ # set the virtualenv up to be associated with the
801
801
# project
802
802
function setvirtualenvproject {
803
803
typeset venv=" $1 "
0 commit comments