activate 2.1 KB

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