Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dff9e253
Kaydet (Commit)
dff9e253
authored
Eki 02, 2013
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #19139: Changed usage of __VENV_NAME__ and added __VENV_PROMPT__.
üst
7c411a40
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
7 deletions
+11
-7
venv.rst
Doc/library/venv.rst
+3
-0
__init__.py
Lib/venv/__init__.py
+2
-1
Activate.ps1
Lib/venv/scripts/nt/Activate.ps1
+1
-1
activate.bat
Lib/venv/scripts/nt/activate.bat
+1
-1
activate
Lib/venv/scripts/posix/activate
+2
-2
activate.fish
Lib/venv/scripts/posix/activate.fish
+2
-2
No files found.
Doc/library/venv.rst
Dosyayı görüntüle @
dff9e253
...
...
@@ -187,6 +187,9 @@ creation according to their needs, the :class:`EnvBuilder` class.
* ``__VENV_NAME__`` is replaced with the environment name (final path
segment of environment directory).
* ``__VENV_PROMPT__`` is replaced with the prompt (the environment
name surrounded by parentheses and with a following space)
* ``__VENV_BIN_NAME__`` is replaced with the name of the bin directory
(either ``bin`` or ``Scripts``).
...
...
Lib/venv/__init__.py
Dosyayı görüntüle @
dff9e253
...
...
@@ -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
...
...
Lib/venv/scripts/nt/Activate.ps1
Dosyayı görüntüle @
dff9e253
...
...
@@ -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
}
...
...
Lib/venv/scripts/nt/activate.bat
Dosyayı görüntüle @
dff9e253
...
...
@@ -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%"
...
...
Lib/venv/scripts/posix/activate
Dosyayı görüntüle @
dff9e253
...
...
@@ -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
...
...
Lib/venv/scripts/posix/activate.fish
Dosyayı görüntüle @
dff9e253
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment