Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous Notification #2370

Closed
wants to merge 156 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
071d9ca
issue-1821
HanilJain Feb 28, 2024
f82e6d2
Merge branch 'main' of https://github.com/HanilJain/BLT
HanilJain Feb 28, 2024
d04211d
Merge branch 'OWASP:main' into main
HanilJain Feb 28, 2024
b613336
Merge branch 'OWASP:main' into main
HanilJain Feb 28, 2024
d5c35b5
Merge branch 'OWASP:main' into main
HanilJain Feb 29, 2024
6aceffa
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 1, 2024
bef50da
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 1, 2024
84d9ae8
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 2, 2024
3215c63
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 3, 2024
7496f64
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 4, 2024
9cb98db
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 4, 2024
00401fd
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 5, 2024
4aec95e
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 5, 2024
ee91bfd
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 6, 2024
809ddad
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 7, 2024
65b6da7
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 7, 2024
d17ccf1
Merge branch 'OWASP-BLT:main' into main
HanilJain Mar 8, 2024
9379ac3
twiiter handle feature
HanilJain Mar 8, 2024
f595224
change
HanilJain Mar 8, 2024
7f8861d
Merge branch 'main' into issue-1918
HanilJain Mar 8, 2024
00f0c10
Merge branch 'main' into issue-1918
HanilJain Mar 8, 2024
51d3b1c
Merge branch 'main' into issue-1918
HanilJain Mar 8, 2024
9268c0f
Update website/views.py
HanilJain Mar 8, 2024
d00ff80
Merge branch 'OWASP-BLT:main' into issue-1918
HanilJain Mar 12, 2024
e76e6b6
@mention feature
HanilJain Mar 12, 2024
62c4528
Merge branch 'main' into issue-1918
HanilJain Mar 13, 2024
b5a4756
commit suggested changes
HanilJain Mar 15, 2024
a99c350
Merge branch 'main' into issue-1918
HanilJain Mar 15, 2024
a814e32
commit
HanilJain Mar 15, 2024
312be01
Merge branch 'issue-1918' of https://github.com/HanilJain/BLT into is…
HanilJain Mar 15, 2024
d9d7f6d
COMMIT
HanilJain Mar 15, 2024
6a32490
Update website/views.py
HanilJain Mar 15, 2024
9d392b2
Update website/views.py
HanilJain Mar 15, 2024
4a0c324
commit
HanilJain Mar 15, 2024
da37828
Update website/models.py
HanilJain Mar 15, 2024
4ce88b3
Merge branch 'issue-1918' of https://github.com/HanilJain/BLT into is…
HanilJain Mar 15, 2024
1b580f8
Merge branch 'main' into issue-1918
HanilJain Mar 17, 2024
42ad499
Merge branch 'main' into issue-1918
HanilJain Mar 17, 2024
fc75aa0
Merge branch 'main' into issue-1918
HanilJain Mar 27, 2024
edc8519
Merge branch 'main' into issue-1918
HanilJain Mar 27, 2024
79faabd
suggestion
HanilJain Mar 27, 2024
d97a575
Merge branch 'issue-1918' of https://github.com/HanilJain/BLT into is…
HanilJain Mar 27, 2024
aff3521
Update website/views.py
HanilJain Mar 28, 2024
c6d06ad
Update website/views.py
HanilJain Mar 28, 2024
db6a3f2
commit
HanilJain Mar 28, 2024
6f3ff14
Merge branch 'issue-1918' of https://github.com/HanilJain/BLT into is…
HanilJain Mar 28, 2024
c50ecfd
Update website/views.py
HanilJain Mar 31, 2024
7d4a1fa
Merge branch 'main' into issue-1918
HanilJain Mar 31, 2024
7b72286
commit
HanilJain Apr 1, 2024
8b33f7b
subdomain error fixed
HanilJain Apr 16, 2024
d4276a0
POST removed
HanilJain Apr 17, 2024
4d995f4
Merge branch 'main' into issue-2039
HanilJain Apr 17, 2024
0edb42f
Merge branch 'main' into issue-2039
DonnieBLT Apr 18, 2024
85f796c
Update website/views.py
HanilJain Apr 20, 2024
eabac26
Merge branch 'main' into issue-2039
HanilJain Apr 20, 2024
daf44ab
commit
HanilJain May 28, 2024
00cbaa4
poetry
HanilJain May 28, 2024
7c6eaf1
commit
HanilJain May 28, 2024
27324a6
Add image validation for screenshots in IssueCreate view
DonnieBLT Apr 20, 2024
830e9e2
Update auto-approve-dependabot.yml
DonnieBLT Apr 20, 2024
a5cfb7b
Update managers field in Domain model
DonnieBLT Apr 20, 2024
a128c1c
Added a slider when there are multiple screenshots for an issue (#2050)
thedudeontitan Apr 22, 2024
747bc3d
Update sponsor wallet address link
DonnieBLT Apr 28, 2024
4b0768e
poetry update
HanilJain May 30, 2024
28862d6
poetry update
HanilJain May 30, 2024
4e915ed
clear get
DonnieBLT May 4, 2024
2dfe1da
Update auto-approve-dependabot.yml
DonnieBLT May 4, 2024
0111370
handle cases where elements might not exist
DonnieBLT May 4, 2024
53b2ec2
fix n+1 query for scoreboard
DonnieBLT May 4, 2024
b9c228e
company api for get and post (#2083)
Uttkarsh-raj May 9, 2024
40a8d86
company id issue resolved while creating the companies (#2089)
Uttkarsh-raj May 11, 2024
981a0e5
Enhancement: Bug Details Page: 5 (#2065)
CodeWithBishal May 11, 2024
cc4fa89
Issue #2043 (#2085)
Sarthak5598 May 11, 2024
297c1d0
Update views.py
DonnieBLT May 12, 2024
0727d36
Bch address (#2095)
Sarthak5598 May 14, 2024
5d0a659
Created API's for Get Open and Closed Issues (#2090)
Uttkarsh-raj May 15, 2024
f33af30
Refactor API Issues endpoint code (#2097)
arkid15r May 16, 2024
4548e14
Make a Form for admins to accept Bids #2093 (#2104)
Sarthak5598 May 21, 2024
9feda49
Update auto-approve-dependabot.yml
DonnieBLT May 24, 2024
a09394a
Bump django-import-export from 3.3.7 to 4.0.5 (#2112)
dependabot[bot] May 24, 2024
a4297da
Enhancement: Bug Details Page: 6 (#2102)
CodeWithBishal May 24, 2024
264fb41
Bump sentry-sdk from 1.42.0 to 2.3.1 (#2111)
dependabot[bot] May 25, 2024
9b99fca
Bump django from 5.0.3 to 5.0.6
dependabot[bot] May 25, 2024
8f0f280
Bump ruff from 0.4.3 to 0.4.5
dependabot[bot] May 25, 2024
0c04905
---
dependabot[bot] May 25, 2024
cf36e59
Bump selenium from 4.18.1 to 4.21.0
dependabot[bot] May 25, 2024
bf6ca55
Bump django-storages from 1.14.2 to 1.14.3
dependabot[bot] May 25, 2024
24e3030
Bump bitcash from 1.0.1 to 1.0.2
dependabot[bot] May 25, 2024
073e258
Bump django-debug-toolbar from 3.8.1 to 4.4.1 (#2115)
dependabot[bot] May 27, 2024
75dff5d
Bump django-debug-toolbar from 4.4.1 to 4.4.2
dependabot[bot] May 28, 2024
ff1d0ee
Bump django-import-export from 4.0.5 to 4.0.6
dependabot[bot] May 28, 2024
6d71fb1
poetry commit
HanilJain May 29, 2024
d0c4c4d
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain May 31, 2024
56fecde
commit
HanilJain Jun 1, 2024
a0e1748
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 1, 2024
ae98875
add balance to sponsor page
DonnieBLT May 4, 2024
5e14b39
Bump ruff from 0.2.2 to 0.4.3
dependabot[bot] May 4, 2024
0228fba
Bump django-import-export from 3.3.7 to 4.0.5 (#2112)
dependabot[bot] May 24, 2024
3963dd2
Bump sentry-sdk from 1.42.0 to 2.3.1 (#2111)
dependabot[bot] May 25, 2024
465884b
Bump django from 5.0.3 to 5.0.6
dependabot[bot] May 25, 2024
58f292b
Bump ruff from 0.4.3 to 0.4.5
dependabot[bot] May 25, 2024
d103068
---
dependabot[bot] May 25, 2024
6c4971b
Bump selenium from 4.18.1 to 4.21.0
dependabot[bot] May 25, 2024
ad4d7f3
Bump django-storages from 1.14.2 to 1.14.3
dependabot[bot] May 25, 2024
3c1bf7c
Bump bitcash from 1.0.1 to 1.0.2
dependabot[bot] May 25, 2024
a6ada94
Bump ruff from 0.4.5 to 0.4.6
dependabot[bot] May 29, 2024
d9ae71a
Bump dj-database-url from 1.3.0 to 2.2.0 (#2119)
dependabot[bot] May 29, 2024
b838900
Bump requests from 2.32.2 to 2.32.3
dependabot[bot] May 30, 2024
fb00656
Bump django-import-export from 4.0.6 to 4.0.7
dependabot[bot] May 31, 2024
9981ea9
twiiter handle feature
HanilJain Mar 8, 2024
0dd042f
change
HanilJain Mar 8, 2024
dfdbc06
@mention feature
HanilJain Mar 12, 2024
7cd474e
commit suggested changes
HanilJain Mar 15, 2024
b477374
Update website/views.py
HanilJain Mar 28, 2024
4c8ab79
Update website/views.py
HanilJain Mar 31, 2024
706e65e
subdomain error fixed
HanilJain Apr 16, 2024
49ca929
Update website/views.py
HanilJain Apr 20, 2024
dbe9946
commit
HanilJain May 28, 2024
5f61417
poetry
HanilJain May 28, 2024
04e8f7f
commit
HanilJain May 28, 2024
3b61301
poetry update
HanilJain May 30, 2024
087a1df
poetry update
HanilJain May 30, 2024
8bbc82d
clear get
DonnieBLT May 4, 2024
2d43a9d
Bump django-import-export from 3.3.7 to 4.0.5 (#2112)
dependabot[bot] May 24, 2024
138cc25
Bump sentry-sdk from 1.42.0 to 2.3.1 (#2111)
dependabot[bot] May 25, 2024
52d8654
Bump django from 5.0.3 to 5.0.6
dependabot[bot] May 25, 2024
e43c8a2
---
dependabot[bot] May 25, 2024
45fa65a
Bump selenium from 4.18.1 to 4.21.0
dependabot[bot] May 25, 2024
50b5131
Bump django-storages from 1.14.2 to 1.14.3
dependabot[bot] May 25, 2024
64fecc3
poetry commit
HanilJain May 29, 2024
0f992dd
channels add in poetry
HanilJain Jun 5, 2024
440f7fc
migrate changes
HanilJain Jun 5, 2024
35d9d3b
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 5, 2024
242b8fb
channels[daphne]
HanilJain Jun 6, 2024
4966dfd
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 6, 2024
de8ae09
new changes
HanilJain Jun 6, 2024
0907261
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 6, 2024
72e07ca
issue
HanilJain Jun 6, 2024
72ba600
issue
HanilJain Jun 6, 2024
f8c0a17
check
HanilJain Jun 6, 2024
43495fb
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 6, 2024
241a260
commit
HanilJain Jun 6, 2024
7cd6901
poetry
HanilJain Jun 6, 2024
75333b1
final commit
HanilJain Jun 6, 2024
01f8245
Redis working
HanilJain Jun 6, 2024
67b72a1
entry point
HanilJain Jun 12, 2024
5a85988
push
HanilJain Jun 12, 2024
4c9dc88
push
HanilJain Jun 12, 2024
80340be
final commit
HanilJain Jun 12, 2024
f7b4ed6
notification system working
HanilJain Jun 15, 2024
6ba703c
notification working
HanilJain Jun 16, 2024
073711d
notification working
HanilJain Jun 24, 2024
d390f60
notification remove
HanilJain Jun 24, 2024
3279725
Merge branch 'hanil_project_1' into hanil_project_1
HanilJain Jun 25, 2024
bc1790d
chanegs
HanilJain Jun 25, 2024
989d1cd
Merge branch 'hanil_project_1' of https://github.com/HanilJain/BLT in…
HanilJain Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ RUN apt-get update && apt-get install -y \
libmemcached11 \
libmemcachedutil2 \
libmemcached-dev \
libz-dev
libz-dev \
redis


RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry lock --no-update
RUN poetry install

RUN python manage.py migrate
Expand Down
28 changes: 28 additions & 0 deletions blt/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
ASGI config for channels_celery_project project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""

import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blt.settings")
django.setup()

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application

from notification_app.routing import websocket_urlpatterns

application = ProtocolTypeRouter(
{
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
}
)
247 changes: 247 additions & 0 deletions blt/bin/Activate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)

<# Function declarations --------------------------------------------------- #>

<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values

# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}

# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}

# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}

# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}

# Just remove VIRTUAL_ENV_PROMPT altogether.
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
}

# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}

# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}

<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"

# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue

# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }

if ($pyvenvConfigPath) {

Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath

$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]

# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}

$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}


<# Begin Activate script --------------------------------------------------- #>

# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath

Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"

# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}

# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir

# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}

Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"

# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive

# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir

if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {

Write-Verbose "Setting prompt to '$Prompt'"

# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt

function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
$env:VIRTUAL_ENV_PROMPT = $Prompt
}

# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}

# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
70 changes: 70 additions & 0 deletions blt/bin/activate
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This file must be used with "source bin/activate" *from bash*
# You cannot run it directly

deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi

# Call hash to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
hash -r 2> /dev/null

if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi

unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}

# unset irrelevant variables
deactivate nondestructive

# on Windows, a path can contain colons and backslashes and has to be converted:
if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] ; then
# transform D:\path\to\venv to /d/path/to/venv on MSYS
# and to /cygdrive/d/path/to/venv on Cygwin
export VIRTUAL_ENV=$(cygpath "/home/hanil/BLT/blt")
else
# use the path as-is
export VIRTUAL_ENV="/home/hanil/BLT/blt"
fi

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(blt) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(blt) "
export VIRTUAL_ENV_PROMPT
fi

# Call hash to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
hash -r 2> /dev/null
27 changes: 27 additions & 0 deletions blt/bin/activate.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.

# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>

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'

# Unset irrelevant variables.
deactivate nondestructive

setenv VIRTUAL_ENV "/home/hanil/BLT/blt"

set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"


set _OLD_VIRTUAL_PROMPT="$prompt"

if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(blt) $prompt"
setenv VIRTUAL_ENV_PROMPT "(blt) "
endif

alias pydoc python -m pydoc

rehash
Loading
Loading