activate 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # This file must be used with "source bin/activate" *from bash*
  2. # you cannot run it directly
  3. deactivate () {
  4. unset pydoc
  5. # reset old environment variables
  6. if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
  7. PATH="$_OLD_VIRTUAL_PATH"
  8. export PATH
  9. unset _OLD_VIRTUAL_PATH
  10. fi
  11. if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
  12. PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
  13. export PYTHONHOME
  14. unset _OLD_VIRTUAL_PYTHONHOME
  15. fi
  16. # This should detect bash and zsh, which have a hash command that must
  17. # be called to get it to forget past commands. Without forgetting
  18. # past commands the $PATH changes we made may not be respected
  19. if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
  20. hash -r 2>/dev/null
  21. fi
  22. if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
  23. PS1="$_OLD_VIRTUAL_PS1"
  24. export PS1
  25. unset _OLD_VIRTUAL_PS1
  26. fi
  27. unset VIRTUAL_ENV
  28. if [ ! "$1" = "nondestructive" ] ; then
  29. # Self destruct!
  30. unset -f deactivate
  31. fi
  32. }
  33. # unset irrelevant variables
  34. deactivate nondestructive
  35. VIRTUAL_ENV="/home/legeox/Documents/Projects/doorbot/examples/ircbot/venv"
  36. export VIRTUAL_ENV
  37. _OLD_VIRTUAL_PATH="$PATH"
  38. PATH="$VIRTUAL_ENV/bin:$PATH"
  39. export PATH
  40. # unset PYTHONHOME if set
  41. # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
  42. # could use `if (set -u; : $PYTHONHOME) ;` in bash
  43. if [ -n "$PYTHONHOME" ] ; then
  44. _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
  45. unset PYTHONHOME
  46. fi
  47. if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
  48. _OLD_VIRTUAL_PS1="$PS1"
  49. if [ "x" != x ] ; then
  50. PS1="$PS1"
  51. else
  52. if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
  53. # special case for Aspen magic directories
  54. # see http://www.zetadev.com/software/aspen/
  55. PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
  56. else
  57. PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
  58. fi
  59. fi
  60. export PS1
  61. fi
  62. alias pydoc="python -m pydoc"
  63. # This should detect bash and zsh, which have a hash command that must
  64. # be called to get it to forget past commands. Without forgetting
  65. # past commands the $PATH changes we made may not be respected
  66. if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
  67. hash -r 2>/dev/null
  68. fi