diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2017-06-10 19:58:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 19:58:42 (GMT) |
commit | 6b6e68776663c0dda04b6a36609297728da2ae9e (patch) | |
tree | 893a56bd5943397b5c1a25c49d707d4000e7e5a4 /Lib/venv | |
parent | 29fda8db16e0edab92841277fa223f844f5a92cc (diff) | |
download | cpython-6b6e68776663c0dda04b6a36609297728da2ae9e.zip cpython-6b6e68776663c0dda04b6a36609297728da2ae9e.tar.gz cpython-6b6e68776663c0dda04b6a36609297728da2ae9e.tar.bz2 |
bpo-27425: Be more explicit in .gitattributes (GH-840)
Updates checked-in line endings on several files.
Diffstat (limited to 'Lib/venv')
-rw-r--r-- | Lib/venv/scripts/nt/Activate.ps1 | 102 | ||||
-rw-r--r-- | Lib/venv/scripts/nt/activate.bat | 64 | ||||
-rw-r--r-- | Lib/venv/scripts/nt/deactivate.bat | 42 |
3 files changed, 104 insertions, 104 deletions
diff --git a/Lib/venv/scripts/nt/Activate.ps1 b/Lib/venv/scripts/nt/Activate.ps1 index 85646c8..bf60869 100644 --- a/Lib/venv/scripts/nt/Activate.ps1 +++ b/Lib/venv/scripts/nt/Activate.ps1 @@ -1,51 +1,51 @@ -function global:deactivate ([switch]$NonDestructive) {
- # Revert to original values
- if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
- copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
- remove-item function:_OLD_VIRTUAL_PROMPT
- }
-
- if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
- copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
- remove-item env:_OLD_VIRTUAL_PYTHONHOME
- }
-
- if (Test-Path env:_OLD_VIRTUAL_PATH) {
- copy-item env:_OLD_VIRTUAL_PATH env:PATH
- remove-item env:_OLD_VIRTUAL_PATH
- }
-
- if (Test-Path env:VIRTUAL_ENV) {
- remove-item env:VIRTUAL_ENV
- }
-
- if (!$NonDestructive) {
- # Self destruct!
- remove-item function:deactivate
- }
-}
-
-deactivate -nondestructive
-
-$env:VIRTUAL_ENV="__VENV_DIR__"
-
-if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
- # Set the prompt to include the env name
- # Make sure _OLD_VIRTUAL_PROMPT is global
- function global:_OLD_VIRTUAL_PROMPT {""}
- copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
- function global:prompt {
- Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
- _OLD_VIRTUAL_PROMPT
- }
-}
-
-# Clear PYTHONHOME
-if (Test-Path env:PYTHONHOME) {
- copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
- remove-item env:PYTHONHOME
-}
-
-# Add the venv to the PATH
-copy-item env:PATH env:_OLD_VIRTUAL_PATH
-$env:PATH = "$env:VIRTUAL_ENV\__VENV_BIN_NAME__;$env:PATH"
+function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + if (Test-Path function:_OLD_VIRTUAL_PROMPT) { + copy-item function:_OLD_VIRTUAL_PROMPT function:prompt + remove-item function:_OLD_VIRTUAL_PROMPT + } + + if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) { + copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME + remove-item env:_OLD_VIRTUAL_PYTHONHOME + } + + if (Test-Path env:_OLD_VIRTUAL_PATH) { + copy-item env:_OLD_VIRTUAL_PATH env:PATH + remove-item env:_OLD_VIRTUAL_PATH + } + + if (Test-Path env:VIRTUAL_ENV) { + remove-item env:VIRTUAL_ENV + } + + if (!$NonDestructive) { + # Self destruct! + remove-item function:deactivate + } +} + +deactivate -nondestructive + +$env:VIRTUAL_ENV="__VENV_DIR__" + +if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) { + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT {""} + copy-item function:prompt function:_OLD_VIRTUAL_PROMPT + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__' + _OLD_VIRTUAL_PROMPT + } +} + +# Clear PYTHONHOME +if (Test-Path env:PYTHONHOME) { + copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME + remove-item env:PYTHONHOME +} + +# Add the venv to the PATH +copy-item env:PATH env:_OLD_VIRTUAL_PATH +$env:PATH = "$env:VIRTUAL_ENV\__VENV_BIN_NAME__;$env:PATH" diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat index 9eab147..d76ca13 100644 --- a/Lib/venv/scripts/nt/activate.bat +++ b/Lib/venv/scripts/nt/activate.bat @@ -1,32 +1,32 @@ -@echo off
-set "VIRTUAL_ENV=__VENV_DIR__"
-
-if not defined PROMPT (
- set "PROMPT=$P$G"
-)
-
-if defined _OLD_VIRTUAL_PROMPT (
- set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
-)
-
-if defined _OLD_VIRTUAL_PYTHONHOME (
- set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
-)
-
-set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
-set "PROMPT=__VENV_PROMPT__%PROMPT%"
-
-if defined PYTHONHOME (
- set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
- set PYTHONHOME=
-)
-
-if defined _OLD_VIRTUAL_PATH (
- set "PATH=%_OLD_VIRTUAL_PATH%"
-) else (
- set "_OLD_VIRTUAL_PATH=%PATH%"
-)
-
-set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%"
-
-:END
+@echo off +set "VIRTUAL_ENV=__VENV_DIR__" + +if not defined PROMPT ( + set "PROMPT=$P$G" +) + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" +) + +set "_OLD_VIRTUAL_PROMPT=%PROMPT%" +set "PROMPT=__VENV_PROMPT__%PROMPT%" + +if defined PYTHONHOME ( + set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%" + set PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) else ( + set "_OLD_VIRTUAL_PATH=%PATH%" +) + +set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" + +:END diff --git a/Lib/venv/scripts/nt/deactivate.bat b/Lib/venv/scripts/nt/deactivate.bat index 313c079..1205c61 100644 --- a/Lib/venv/scripts/nt/deactivate.bat +++ b/Lib/venv/scripts/nt/deactivate.bat @@ -1,21 +1,21 @@ -@echo off
-
-if defined _OLD_VIRTUAL_PROMPT (
- set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
-)
-set _OLD_VIRTUAL_PROMPT=
-
-if defined _OLD_VIRTUAL_PYTHONHOME (
- set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
- set _OLD_VIRTUAL_PYTHONHOME=
-)
-
-if defined _OLD_VIRTUAL_PATH (
- set "PATH=%_OLD_VIRTUAL_PATH%"
-)
-
-set _OLD_VIRTUAL_PATH=
-
-set VIRTUAL_ENV=
-
-:END
+@echo off + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) +set _OLD_VIRTUAL_PROMPT= + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" + set _OLD_VIRTUAL_PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) + +set _OLD_VIRTUAL_PATH= + +set VIRTUAL_ENV= + +:END |