File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 9
9
quoted. Addresses :bbissue: `164 `.
10
10
- Add :ref: `command-wipeenv ` command for removing all packages
11
11
installed in the virtualenv.
12
+ - Allow users of ``virtualenvwrapper_lazy.sh `` to extend the list of
13
+ API commands that trigger the lazy-loader by extending
14
+ ``_VIRTUALENVWRAPPER_API ``. Patch contributed by John Purnell, see
15
+ :bbissue: `188 `.
12
16
13
17
4.0
14
18
===
Original file line number Diff line number Diff line change
1
+ # -*- mode: shell-script -*-
2
+
3
+ test_dir=$( cd $( dirname $0 ) && pwd)
4
+ source " $test_dir /setup.sh"
5
+
6
+ oneTimeSetUp () {
7
+ rm -rf " $WORKON_HOME "
8
+ mkdir -p " $WORKON_HOME "
9
+ [ ! -z " $ZSH_VERSION " ] && unsetopt shwordsplit
10
+ }
11
+
12
+ oneTimeTearDown () {
13
+ rm -rf " $WORKON_HOME "
14
+ }
15
+
16
+ setUp () {
17
+ echo
18
+ rm -f " $test_dir /catch_output"
19
+ }
20
+
21
+ function_defined_lazy () {
22
+ name=" $1 "
23
+ assertTrue " $name not defined" " type $name "
24
+ assertTrue " $name does not load virtualenvwrapper" " typeset -f $name | grep 'virtualenvwrapper_load'"
25
+ if [ " $name " = " mkvirtualenv" ]
26
+ then
27
+ lookfor=" rmvirtualenv"
28
+ else
29
+ lookfor=" mkvirtualenv"
30
+ fi
31
+ assertFalse " $name includes reference to $lookfor : $( typeset -f $name ) " " typeset -f $name | grep $lookfor "
32
+ }
33
+
34
+ test_custom_defined_lazy () {
35
+ _VIRTUALENVWRAPPER_API=" my_custom_command"
36
+ source " $test_dir /../virtualenvwrapper_lazy.sh"
37
+ function_defined_lazy my_custom_command
38
+ }
39
+
40
+ . " $test_dir /shunit2"
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
# Alternative startup script for faster login times.
3
3
4
- export _VIRTUALENVWRAPPER_API=" mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv"
4
+ export _VIRTUALENVWRAPPER_API=" $_VIRTUALENVWRAPPER_API mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv"
5
5
6
6
if [ -z " $VIRTUALENVWRAPPER_SCRIPT " ]
7
7
then
You can’t perform that action at this time.
0 commit comments