Skip to content

Commit 87ea536

Browse files
author
Sergey Vorfolomeev
committed
Fix CRLF
1 parent 0b77b9f commit 87ea536

File tree

3 files changed

+161
-161
lines changed

3 files changed

+161
-161
lines changed

Lib/venv/scripts/common/activate

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
# This file must be used with "source bin/activate" *from bash*
2-
# you cannot run it directly
3-
4-
deactivate () {
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-
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:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21-
hash -r 2> /dev/null
22-
fi
23-
24-
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
25-
PS1="${_OLD_VIRTUAL_PS1:-}"
26-
export PS1
27-
unset _OLD_VIRTUAL_PS1
28-
fi
29-
30-
unset VIRTUAL_ENV
31-
unset VIRTUAL_ENV_PROMPT
32-
if [ ! "${1:-}" = "nondestructive" ] ; then
33-
# Self destruct!
34-
unset -f deactivate
35-
fi
36-
}
37-
38-
# unset irrelevant variables
39-
deactivate nondestructive
40-
41-
VIRTUAL_ENV="__VENV_DIR__"
42-
export VIRTUAL_ENV
43-
44-
_OLD_VIRTUAL_PATH="$PATH"
45-
PATH="$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
46-
export PATH
47-
48-
# unset PYTHONHOME if set
49-
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
50-
# could use `if (set -u; : $PYTHONHOME) ;` in bash
51-
if [ -n "${PYTHONHOME:-}" ] ; then
52-
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
53-
unset PYTHONHOME
54-
fi
55-
56-
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
57-
_OLD_VIRTUAL_PS1="${PS1:-}"
58-
PS1="__VENV_PROMPT__${PS1:-}"
59-
export PS1
60-
VIRTUAL_ENV_PROMPT="__VENV_PROMPT__"
61-
export VIRTUAL_ENV_PROMPT
62-
fi
63-
64-
# This should detect bash and zsh, which have a hash command that must
65-
# be called to get it to forget past commands. Without forgetting
66-
# past commands the $PATH changes we made may not be respected
67-
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
68-
hash -r 2> /dev/null
69-
fi
1+
# This file must be used with "source bin/activate" *from bash*
2+
# you cannot run it directly
3+
4+
deactivate () {
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+
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:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21+
hash -r 2> /dev/null
22+
fi
23+
24+
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
25+
PS1="${_OLD_VIRTUAL_PS1:-}"
26+
export PS1
27+
unset _OLD_VIRTUAL_PS1
28+
fi
29+
30+
unset VIRTUAL_ENV
31+
unset VIRTUAL_ENV_PROMPT
32+
if [ ! "${1:-}" = "nondestructive" ] ; then
33+
# Self destruct!
34+
unset -f deactivate
35+
fi
36+
}
37+
38+
# unset irrelevant variables
39+
deactivate nondestructive
40+
41+
VIRTUAL_ENV="__VENV_DIR__"
42+
export VIRTUAL_ENV
43+
44+
_OLD_VIRTUAL_PATH="$PATH"
45+
PATH="$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
46+
export PATH
47+
48+
# unset PYTHONHOME if set
49+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
50+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
51+
if [ -n "${PYTHONHOME:-}" ] ; then
52+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
53+
unset PYTHONHOME
54+
fi
55+
56+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
57+
_OLD_VIRTUAL_PS1="${PS1:-}"
58+
PS1="__VENV_PROMPT__${PS1:-}"
59+
export PS1
60+
VIRTUAL_ENV_PROMPT="__VENV_PROMPT__"
61+
export VIRTUAL_ENV_PROMPT
62+
fi
63+
64+
# This should detect bash and zsh, which have a hash command that must
65+
# be called to get it to forget past commands. Without forgetting
66+
# past commands the $PATH changes we made may not be respected
67+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
68+
hash -r 2> /dev/null
69+
fi

Lib/venv/scripts/posix/activate.csh

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# This file must be used with "source bin/activate.csh" *from csh*.
2-
# You cannot run it directly.
3-
# Created by Davide Di Blasi <[email protected]>.
4-
# Ported to Python 3.3 venv by Andrew Svetlov <[email protected]>
5-
6-
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
7-
8-
# Unset irrelevant variables.
9-
deactivate nondestructive
10-
11-
setenv VIRTUAL_ENV "__VENV_DIR__"
12-
13-
set _OLD_VIRTUAL_PATH="$PATH"
14-
setenv PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
15-
16-
17-
set _OLD_VIRTUAL_PROMPT="$prompt"
18-
19-
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
20-
set prompt = "__VENV_PROMPT__$prompt"
21-
setenv VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
22-
endif
23-
24-
alias pydoc python -m pydoc
25-
26-
rehash
1+
# This file must be used with "source bin/activate.csh" *from csh*.
2+
# You cannot run it directly.
3+
# Created by Davide Di Blasi <[email protected]>.
4+
# Ported to Python 3.3 venv by Andrew Svetlov <[email protected]>
5+
6+
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
7+
8+
# Unset irrelevant variables.
9+
deactivate nondestructive
10+
11+
setenv VIRTUAL_ENV "__VENV_DIR__"
12+
13+
set _OLD_VIRTUAL_PATH="$PATH"
14+
setenv PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
15+
16+
17+
set _OLD_VIRTUAL_PROMPT="$prompt"
18+
19+
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
20+
set prompt = "__VENV_PROMPT__$prompt"
21+
setenv VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
22+
endif
23+
24+
alias pydoc python -m pydoc
25+
26+
rehash

Lib/venv/scripts/posix/activate.fish

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
1-
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
2-
# (https://fishshell.com/); you cannot run it directly.
3-
4-
function deactivate -d "Exit virtual environment and return to normal shell environment"
5-
# reset old environment variables
6-
if test -n "$_OLD_VIRTUAL_PATH"
7-
set -gx PATH $_OLD_VIRTUAL_PATH
8-
set -e _OLD_VIRTUAL_PATH
9-
end
10-
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
11-
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
12-
set -e _OLD_VIRTUAL_PYTHONHOME
13-
end
14-
15-
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
16-
functions -e fish_prompt
17-
set -e _OLD_FISH_PROMPT_OVERRIDE
18-
functions -c _old_fish_prompt fish_prompt
19-
functions -e _old_fish_prompt
20-
end
21-
22-
set -e VIRTUAL_ENV
23-
set -e VIRTUAL_ENV_PROMPT
24-
if test "$argv[1]" != "nondestructive"
25-
# Self-destruct!
26-
functions -e deactivate
27-
end
28-
end
29-
30-
# Unset irrelevant variables.
31-
deactivate nondestructive
32-
33-
set -gx VIRTUAL_ENV "__VENV_DIR__"
34-
35-
set -gx _OLD_VIRTUAL_PATH $PATH
36-
set -gx PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__" $PATH
37-
38-
# Unset PYTHONHOME if set.
39-
if set -q PYTHONHOME
40-
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
41-
set -e PYTHONHOME
42-
end
43-
44-
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
45-
# fish uses a function instead of an env var to generate the prompt.
46-
47-
# Save the current fish_prompt function as the function _old_fish_prompt.
48-
functions -c fish_prompt _old_fish_prompt
49-
50-
# With the original prompt function renamed, we can override with our own.
51-
function fish_prompt
52-
# Save the return status of the last command.
53-
set -l old_status $status
54-
55-
# Output the venv prompt; color taken from the blue of the Python logo.
56-
printf "%s%s%s" (set_color 4B8BBE) "__VENV_PROMPT__" (set_color normal)
57-
58-
# Restore the return status of the previous command.
59-
echo "exit $old_status" | .
60-
# Output the original/"old" prompt.
61-
_old_fish_prompt
62-
end
63-
64-
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
65-
set -gx VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
66-
end
1+
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
2+
# (https://fishshell.com/); you cannot run it directly.
3+
4+
function deactivate -d "Exit virtual environment and return to normal shell environment"
5+
# reset old environment variables
6+
if test -n "$_OLD_VIRTUAL_PATH"
7+
set -gx PATH $_OLD_VIRTUAL_PATH
8+
set -e _OLD_VIRTUAL_PATH
9+
end
10+
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
11+
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
12+
set -e _OLD_VIRTUAL_PYTHONHOME
13+
end
14+
15+
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
16+
functions -e fish_prompt
17+
set -e _OLD_FISH_PROMPT_OVERRIDE
18+
functions -c _old_fish_prompt fish_prompt
19+
functions -e _old_fish_prompt
20+
end
21+
22+
set -e VIRTUAL_ENV
23+
set -e VIRTUAL_ENV_PROMPT
24+
if test "$argv[1]" != "nondestructive"
25+
# Self-destruct!
26+
functions -e deactivate
27+
end
28+
end
29+
30+
# Unset irrelevant variables.
31+
deactivate nondestructive
32+
33+
set -gx VIRTUAL_ENV "__VENV_DIR__"
34+
35+
set -gx _OLD_VIRTUAL_PATH $PATH
36+
set -gx PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__" $PATH
37+
38+
# Unset PYTHONHOME if set.
39+
if set -q PYTHONHOME
40+
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
41+
set -e PYTHONHOME
42+
end
43+
44+
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
45+
# fish uses a function instead of an env var to generate the prompt.
46+
47+
# Save the current fish_prompt function as the function _old_fish_prompt.
48+
functions -c fish_prompt _old_fish_prompt
49+
50+
# With the original prompt function renamed, we can override with our own.
51+
function fish_prompt
52+
# Save the return status of the last command.
53+
set -l old_status $status
54+
55+
# Output the venv prompt; color taken from the blue of the Python logo.
56+
printf "%s%s%s" (set_color 4B8BBE) "__VENV_PROMPT__" (set_color normal)
57+
58+
# Restore the return status of the previous command.
59+
echo "exit $old_status" | .
60+
# Output the original/"old" prompt.
61+
_old_fish_prompt
62+
end
63+
64+
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
65+
set -gx VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
66+
end

0 commit comments

Comments
 (0)