addon-sdk/source/bin/activate

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/addon-sdk/source/bin/activate	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,84 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +# This file must be used with "source bin/activate" *from bash*
     1.9 +# you cannot run it directly
    1.10 +
    1.11 +deactivate () {
    1.12 +    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
    1.13 +        PATH="$_OLD_VIRTUAL_PATH"
    1.14 +        export PATH
    1.15 +        unset _OLD_VIRTUAL_PATH
    1.16 +    fi
    1.17 +
    1.18 +    # This should detect bash and zsh, which have a hash command that must
    1.19 +    # be called to get it to forget past commands.  Without forgetting
    1.20 +    # past commands the $PATH changes we made may not be respected
    1.21 +    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
    1.22 +        hash -r
    1.23 +    fi
    1.24 +
    1.25 +    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
    1.26 +        PS1="$_OLD_VIRTUAL_PS1"
    1.27 +        export PS1
    1.28 +        unset _OLD_VIRTUAL_PS1
    1.29 +    fi
    1.30 +
    1.31 +    PYTHONPATH="$_OLD_PYTHONPATH"
    1.32 +    export PYTHONPATH
    1.33 +    unset _OLD_PYTHONPATH
    1.34 +
    1.35 +    unset CUDDLEFISH_ROOT
    1.36 +
    1.37 +    unset VIRTUAL_ENV
    1.38 +    if [ ! "$1" = "nondestructive" ] ; then
    1.39 +    # Self destruct!
    1.40 +        unset deactivate
    1.41 +    fi
    1.42 +}
    1.43 +
    1.44 +# unset irrelavent variables
    1.45 +deactivate nondestructive
    1.46 +
    1.47 +_OLD_PYTHONPATH="$PYTHONPATH"
    1.48 +_OLD_VIRTUAL_PATH="$PATH"
    1.49 +
    1.50 +VIRTUAL_ENV="`pwd`"
    1.51 +
    1.52 +if [ "x$OSTYPE" = "xmsys" ] ; then
    1.53 +  CUDDLEFISH_ROOT="`pwd -W | sed s,/,\\\\\\\\,g`"
    1.54 +  PATH="`pwd`/bin:$PATH"
    1.55 +  # msys will convert any env vars with PATH in it to use msys
    1.56 +  # form and will unconvert before launching
    1.57 +  PYTHONPATH="`pwd -W`/python-lib;$PYTHONPATH"
    1.58 +else
    1.59 +  CUDDLEFISH_ROOT="$VIRTUAL_ENV"
    1.60 +  PYTHONPATH="$VIRTUAL_ENV/python-lib:$PYTHONPATH"
    1.61 +  PATH="$VIRTUAL_ENV/bin:$PATH"
    1.62 +fi
    1.63 +
    1.64 +VIRTUAL_ENV="`pwd`"
    1.65 +
    1.66 +export CUDDLEFISH_ROOT
    1.67 +export PYTHONPATH
    1.68 +export PATH
    1.69 +
    1.70 +_OLD_VIRTUAL_PS1="$PS1"
    1.71 +if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
    1.72 +    # special case for Aspen magic directories
    1.73 +    # see http://www.zetadev.com/software/aspen/
    1.74 +    PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
    1.75 +else
    1.76 +    PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
    1.77 +fi
    1.78 +export PS1
    1.79 +
    1.80 +# This should detect bash and zsh, which have a hash command that must
    1.81 +# be called to get it to forget past commands.  Without forgetting
    1.82 +# past commands the $PATH changes we made may not be respected
    1.83 +if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
    1.84 +    hash -r
    1.85 +fi
    1.86 +
    1.87 +python -c "from jetpack_sdk_env import welcome; welcome()"

mercurial