SEESenv/bin/activate
changeset 3 6cee07c589cb
equal deleted inserted replaced
2:52d12eb31c30 3:6cee07c589cb
       
     1 # This file must be used with "source bin/activate" *from bash*
       
     2 # you cannot run it directly
       
     3 
       
     4 deactivate () {
       
     5     if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
       
     6         PATH="$_OLD_VIRTUAL_PATH"
       
     7         export PATH
       
     8         unset _OLD_VIRTUAL_PATH
       
     9     fi
       
    10 
       
    11     # This should detect bash and zsh, which have a hash command that must
       
    12     # be called to get it to forget past commands.  Without forgetting
       
    13     # past commands the $PATH changes we made may not be respected
       
    14     if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
       
    15         hash -r
       
    16     fi
       
    17 
       
    18     if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
       
    19         PS1="$_OLD_VIRTUAL_PS1"
       
    20         export PS1
       
    21         unset _OLD_VIRTUAL_PS1
       
    22     fi
       
    23 
       
    24     unset VIRTUAL_ENV
       
    25     if [ ! "$1" = "nondestructive" ] ; then
       
    26     # Self destruct!
       
    27         unset -f deactivate
       
    28     fi
       
    29 }
       
    30 
       
    31 # unset irrelavent variables
       
    32 deactivate nondestructive
       
    33 
       
    34 VIRTUAL_ENV="/home/amit/SEES-hacks/SEESenv"
       
    35 export VIRTUAL_ENV
       
    36 
       
    37 _OLD_VIRTUAL_PATH="$PATH"
       
    38 PATH="$VIRTUAL_ENV/bin:$PATH"
       
    39 export PATH
       
    40 
       
    41 _OLD_VIRTUAL_PS1="$PS1"
       
    42 if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
       
    43     # special case for Aspen magic directories
       
    44     # see http://www.zetadev.com/software/aspen/
       
    45     PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
       
    46 else
       
    47     PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
       
    48 fi
       
    49 export PS1
       
    50 
       
    51 # This should detect bash and zsh, which have a hash command that must
       
    52 # be called to get it to forget past commands.  Without forgetting
       
    53 # past commands the $PATH changes we made may not be respected
       
    54 if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
       
    55     hash -r
       
    56 fi