summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-10-02 10:36:16 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-10-02 10:36:16 (GMT)
commitdff9e2535f5bf73f1491edc45928eef51a701074 (patch)
treea8345bf9e94fb6095a0eb41da069232184009fe1 /Lib/venv
parent7c411a40413d9525aeb6114d71be3e012dbf81f5 (diff)
downloadcpython-dff9e2535f5bf73f1491edc45928eef51a701074.zip
cpython-dff9e2535f5bf73f1491edc45928eef51a701074.tar.gz
cpython-dff9e2535f5bf73f1491edc45928eef51a701074.tar.bz2
Closes #19139: Changed usage of __VENV_NAME__ and added __VENV_PROMPT__.
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py3
-rw-r--r--Lib/venv/scripts/nt/Activate.ps12
-rw-r--r--Lib/venv/scripts/nt/activate.bat2
-rw-r--r--Lib/venv/scripts/posix/activate4
-rw-r--r--Lib/venv/scripts/posix/activate.fish4
5 files changed, 8 insertions, 7 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 1688bc4..f184328 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -261,7 +261,8 @@ class EnvBuilder:
being processed.
"""
text = text.replace('__VENV_DIR__', context.env_dir)
- text = text.replace('__VENV_NAME__', context.prompt)
+ text = text.replace('__VENV_NAME__', context.env_name)
+ text = text.replace('__VENV_PROMPT__', context.prompt)
text = text.replace('__VENV_BIN_NAME__', context.bin_name)
text = text.replace('__VENV_PYTHON__', context.env_exe)
return text
diff --git a/Lib/venv/scripts/nt/Activate.ps1 b/Lib/venv/scripts/nt/Activate.ps1
index df78963..b15decb 100644
--- a/Lib/venv/scripts/nt/Activate.ps1
+++ b/Lib/venv/scripts/nt/Activate.ps1
@@ -34,7 +34,7 @@ $env:VIRTUAL_ENV="__VENV_DIR__"
function global:_OLD_VIRTUAL_PROMPT {""}
copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
function global:prompt {
- Write-Host -NoNewline -ForegroundColor Green '__VENV_NAME__'
+ Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
_OLD_VIRTUAL_PROMPT
}
diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat
index 3cebe26..9eab147 100644
--- a/Lib/venv/scripts/nt/activate.bat
+++ b/Lib/venv/scripts/nt/activate.bat
@@ -14,7 +14,7 @@ if defined _OLD_VIRTUAL_PYTHONHOME (
)
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
-set "PROMPT=__VENV_NAME__%PROMPT%"
+set "PROMPT=__VENV_PROMPT__%PROMPT%"
if defined PYTHONHOME (
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
diff --git a/Lib/venv/scripts/posix/activate b/Lib/venv/scripts/posix/activate
index c241450..7bbffd9 100644
--- a/Lib/venv/scripts/posix/activate
+++ b/Lib/venv/scripts/posix/activate
@@ -54,8 +54,8 @@ fi
if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
- if [ "x__VENV_NAME__" != x ] ; then
- PS1="__VENV_NAME__$PS1"
+ if [ "x__VENV_PROMPT__" != x ] ; then
+ PS1="__VENV_PROMPT__$PS1"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
diff --git a/Lib/venv/scripts/posix/activate.fish b/Lib/venv/scripts/posix/activate.fish
index 5ac1638..45391aa 100644
--- a/Lib/venv/scripts/posix/activate.fish
+++ b/Lib/venv/scripts/posix/activate.fish
@@ -55,8 +55,8 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# with the original prompt function renamed, we can override with our own.
function fish_prompt
# Prompt override?
- if test -n "__VENV_NAME__"
- printf "%s%s%s" "__VENV_NAME__" (set_color normal) (_old_fish_prompt)
+ if test -n "__VENV_PROMPT__"
+ printf "%s%s%s" "__VENV_PROMPT__" (set_color normal) (_old_fish_prompt)
return
end
# ...Otherwise, prepend env