You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.0 KiB

  1. # This file must be used with "source bin/activate" *from bash*
  2. # you cannot run it directly
  3. deactivate () {
  4. unset -f pydoc >/dev/null 2>&1
  5. # reset old environment variables
  6. # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
  7. if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
  8. PATH="$_OLD_VIRTUAL_PATH"
  9. export PATH
  10. unset _OLD_VIRTUAL_PATH
  11. fi
  12. if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
  13. PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
  14. export PYTHONHOME
  15. unset _OLD_VIRTUAL_PYTHONHOME
  16. fi
  17. # This should detect bash and zsh, which have a hash command that must
  18. # be called to get it to forget past commands. Without forgetting
  19. # past commands the $PATH changes we made may not be respected
  20. if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
  21. hash -r 2>/dev/null
  22. fi
  23. if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
  24. PS1="$_OLD_VIRTUAL_PS1"
  25. export PS1
  26. unset _OLD_VIRTUAL_PS1
  27. fi
  28. unset VIRTUAL_ENV
  29. if [ ! "${1-}" = "nondestructive" ] ; then
  30. # Self destruct!
  31. unset -f deactivate
  32. fi
  33. }
  34. # unset irrelevant variables
  35. deactivate nondestructive
  36. VIRTUAL_ENV="/home/yigido/projects/Food_Cloud/venv"
  37. export VIRTUAL_ENV
  38. _OLD_VIRTUAL_PATH="$PATH"
  39. PATH="$VIRTUAL_ENV/bin:$PATH"
  40. export PATH
  41. # unset PYTHONHOME if set
  42. if ! [ -z "${PYTHONHOME+_}" ] ; then
  43. _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
  44. unset PYTHONHOME
  45. fi
  46. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
  47. _OLD_VIRTUAL_PS1="$PS1"
  48. if [ "x" != x ] ; then
  49. PS1="$PS1"
  50. else
  51. PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
  52. fi
  53. export PS1
  54. fi
  55. # Make sure to unalias pydoc if it's already there
  56. alias pydoc 2>/dev/null >/dev/null && unalias pydoc
  57. pydoc () {
  58. python -m pydoc "$@"
  59. }
  60. # This should detect bash and zsh, which have a hash command that must
  61. # be called to get it to forget past commands. Without forgetting
  62. # past commands the $PATH changes we made may not be respected
  63. if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
  64. hash -r 2>/dev/null
  65. fi