Upload 2050 files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +8 -0
- project 5/.DS_Store +0 -0
- project 5/.bolt/config.json +3 -0
- project 5/.bolt/prompt +5 -0
- project 5/.gitignore +25 -0
- project 5/.venv/.gitignore +1 -0
- project 5/.venv/bin/Activate.ps1 +241 -0
- project 5/.venv/bin/activate +66 -0
- project 5/.venv/bin/activate.csh +25 -0
- project 5/.venv/bin/activate.fish +64 -0
- project 5/.venv/bin/flask +9 -0
- project 5/.venv/bin/normalizer +9 -0
- project 5/.venv/bin/pip +10 -0
- project 5/.venv/bin/pip3 +10 -0
- project 5/.venv/bin/pip3.9 +10 -0
- project 5/.venv/bin/pyrsa-decrypt +9 -0
- project 5/.venv/bin/pyrsa-encrypt +9 -0
- project 5/.venv/bin/pyrsa-keygen +9 -0
- project 5/.venv/bin/pyrsa-priv2pub +9 -0
- project 5/.venv/bin/pyrsa-sign +9 -0
- project 5/.venv/bin/pyrsa-verify +9 -0
- project 5/.venv/bin/tqdm +9 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/INSTALLER +1 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/LICENSE +7 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/METADATA +147 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/RECORD +17 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/REQUESTED +0 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/WHEEL +6 -0
- project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/top_level.txt +1 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/INSTALLER +1 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/LICENSE.txt +28 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/METADATA +92 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/RECORD +14 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/WHEEL +5 -0
- project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/top_level.txt +1 -0
- project 5/.venv/lib/python3.9/site-packages/_distutils_hack/__init__.py +128 -0
- project 5/.venv/lib/python3.9/site-packages/_distutils_hack/override.py +1 -0
- project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/INSTALLER +1 -0
- project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/LICENSE.txt +20 -0
- project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/METADATA +60 -0
- project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/RECORD +12 -0
- project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/WHEEL +4 -0
- project 5/.venv/lib/python3.9/site-packages/blinker/__init__.py +17 -0
- project 5/.venv/lib/python3.9/site-packages/blinker/_utilities.py +64 -0
- project 5/.venv/lib/python3.9/site-packages/blinker/base.py +512 -0
- project 5/.venv/lib/python3.9/site-packages/blinker/py.typed +0 -0
- project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/INSTALLER +1 -0
- project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/LICENSE +20 -0
- project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/METADATA +151 -0
- project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/RECORD +14 -0
.gitattributes
CHANGED
|
@@ -57,3 +57,11 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/charset_normalizer/md__mypyc.cpython-39-darwin.so filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/charset_normalizer/md.cpython-39-darwin.so filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/google/_upb/_message.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-darwin.so filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text
|
| 67 |
+
project[[:space:]]5/.venv/lib/python3.9/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text
|
project 5/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
project 5/.bolt/config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"template": "bolt-vite-react-ts"
|
| 3 |
+
}
|
project 5/.bolt/prompt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
For all designs I ask you to make, have them be beautiful, not cookie cutter. Make webpages that are fully featured and worthy for production.
|
| 2 |
+
|
| 3 |
+
By default, this template supports JSX syntax with Tailwind CSS classes, React hooks, and Lucide React for icons. Do not install other packages for UI themes, icons, etc unless absolutely necessary or I request them.
|
| 4 |
+
|
| 5 |
+
Use icons from lucide-react for logos.
|
project 5/.gitignore
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Logs
|
| 2 |
+
logs
|
| 3 |
+
*.log
|
| 4 |
+
npm-debug.log*
|
| 5 |
+
yarn-debug.log*
|
| 6 |
+
yarn-error.log*
|
| 7 |
+
pnpm-debug.log*
|
| 8 |
+
lerna-debug.log*
|
| 9 |
+
|
| 10 |
+
node_modules
|
| 11 |
+
dist
|
| 12 |
+
dist-ssr
|
| 13 |
+
*.local
|
| 14 |
+
|
| 15 |
+
# Editor directories and files
|
| 16 |
+
.vscode/*
|
| 17 |
+
!.vscode/extensions.json
|
| 18 |
+
.idea
|
| 19 |
+
.DS_Store
|
| 20 |
+
*.suo
|
| 21 |
+
*.ntvs*
|
| 22 |
+
*.njsproj
|
| 23 |
+
*.sln
|
| 24 |
+
*.sw?
|
| 25 |
+
.env
|
project 5/.venv/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*
|
project 5/.venv/bin/Activate.ps1
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<#
|
| 2 |
+
.Synopsis
|
| 3 |
+
Activate a Python virtual environment for the current PowerShell session.
|
| 4 |
+
|
| 5 |
+
.Description
|
| 6 |
+
Pushes the python executable for a virtual environment to the front of the
|
| 7 |
+
$Env:PATH environment variable and sets the prompt to signify that you are
|
| 8 |
+
in a Python virtual environment. Makes use of the command line switches as
|
| 9 |
+
well as the `pyvenv.cfg` file values present in the virtual environment.
|
| 10 |
+
|
| 11 |
+
.Parameter VenvDir
|
| 12 |
+
Path to the directory that contains the virtual environment to activate. The
|
| 13 |
+
default value for this is the parent of the directory that the Activate.ps1
|
| 14 |
+
script is located within.
|
| 15 |
+
|
| 16 |
+
.Parameter Prompt
|
| 17 |
+
The prompt prefix to display when this virtual environment is activated. By
|
| 18 |
+
default, this prompt is the name of the virtual environment folder (VenvDir)
|
| 19 |
+
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
|
| 20 |
+
|
| 21 |
+
.Example
|
| 22 |
+
Activate.ps1
|
| 23 |
+
Activates the Python virtual environment that contains the Activate.ps1 script.
|
| 24 |
+
|
| 25 |
+
.Example
|
| 26 |
+
Activate.ps1 -Verbose
|
| 27 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
| 28 |
+
and shows extra information about the activation as it executes.
|
| 29 |
+
|
| 30 |
+
.Example
|
| 31 |
+
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
|
| 32 |
+
Activates the Python virtual environment located in the specified location.
|
| 33 |
+
|
| 34 |
+
.Example
|
| 35 |
+
Activate.ps1 -Prompt "MyPython"
|
| 36 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
| 37 |
+
and prefixes the current prompt with the specified string (surrounded in
|
| 38 |
+
parentheses) while the virtual environment is active.
|
| 39 |
+
|
| 40 |
+
.Notes
|
| 41 |
+
On Windows, it may be required to enable this Activate.ps1 script by setting the
|
| 42 |
+
execution policy for the user. You can do this by issuing the following PowerShell
|
| 43 |
+
command:
|
| 44 |
+
|
| 45 |
+
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
| 46 |
+
|
| 47 |
+
For more information on Execution Policies:
|
| 48 |
+
https://go.microsoft.com/fwlink/?LinkID=135170
|
| 49 |
+
|
| 50 |
+
#>
|
| 51 |
+
Param(
|
| 52 |
+
[Parameter(Mandatory = $false)]
|
| 53 |
+
[String]
|
| 54 |
+
$VenvDir,
|
| 55 |
+
[Parameter(Mandatory = $false)]
|
| 56 |
+
[String]
|
| 57 |
+
$Prompt
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
<# Function declarations --------------------------------------------------- #>
|
| 61 |
+
|
| 62 |
+
<#
|
| 63 |
+
.Synopsis
|
| 64 |
+
Remove all shell session elements added by the Activate script, including the
|
| 65 |
+
addition of the virtual environment's Python executable from the beginning of
|
| 66 |
+
the PATH variable.
|
| 67 |
+
|
| 68 |
+
.Parameter NonDestructive
|
| 69 |
+
If present, do not remove this function from the global namespace for the
|
| 70 |
+
session.
|
| 71 |
+
|
| 72 |
+
#>
|
| 73 |
+
function global:deactivate ([switch]$NonDestructive) {
|
| 74 |
+
# Revert to original values
|
| 75 |
+
|
| 76 |
+
# The prior prompt:
|
| 77 |
+
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
|
| 78 |
+
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
|
| 79 |
+
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
# The prior PYTHONHOME:
|
| 83 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
|
| 84 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
|
| 85 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
# The prior PATH:
|
| 89 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
|
| 90 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
|
| 91 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
# Just remove the VIRTUAL_ENV altogether:
|
| 95 |
+
if (Test-Path -Path Env:VIRTUAL_ENV) {
|
| 96 |
+
Remove-Item -Path env:VIRTUAL_ENV
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
|
| 100 |
+
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
|
| 101 |
+
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
# Leave deactivate function in the global namespace if requested:
|
| 105 |
+
if (-not $NonDestructive) {
|
| 106 |
+
Remove-Item -Path function:deactivate
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
<#
|
| 111 |
+
.Description
|
| 112 |
+
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
|
| 113 |
+
given folder, and returns them in a map.
|
| 114 |
+
|
| 115 |
+
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
|
| 116 |
+
two strings separated by `=` (with any amount of whitespace surrounding the =)
|
| 117 |
+
then it is considered a `key = value` line. The left hand string is the key,
|
| 118 |
+
the right hand is the value.
|
| 119 |
+
|
| 120 |
+
If the value starts with a `'` or a `"` then the first and last character is
|
| 121 |
+
stripped from the value before being captured.
|
| 122 |
+
|
| 123 |
+
.Parameter ConfigDir
|
| 124 |
+
Path to the directory that contains the `pyvenv.cfg` file.
|
| 125 |
+
#>
|
| 126 |
+
function Get-PyVenvConfig(
|
| 127 |
+
[String]
|
| 128 |
+
$ConfigDir
|
| 129 |
+
) {
|
| 130 |
+
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
|
| 131 |
+
|
| 132 |
+
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
|
| 133 |
+
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
|
| 134 |
+
|
| 135 |
+
# An empty map will be returned if no config file is found.
|
| 136 |
+
$pyvenvConfig = @{ }
|
| 137 |
+
|
| 138 |
+
if ($pyvenvConfigPath) {
|
| 139 |
+
|
| 140 |
+
Write-Verbose "File exists, parse `key = value` lines"
|
| 141 |
+
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
|
| 142 |
+
|
| 143 |
+
$pyvenvConfigContent | ForEach-Object {
|
| 144 |
+
$keyval = $PSItem -split "\s*=\s*", 2
|
| 145 |
+
if ($keyval[0] -and $keyval[1]) {
|
| 146 |
+
$val = $keyval[1]
|
| 147 |
+
|
| 148 |
+
# Remove extraneous quotations around a string value.
|
| 149 |
+
if ("'""".Contains($val.Substring(0, 1))) {
|
| 150 |
+
$val = $val.Substring(1, $val.Length - 2)
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
$pyvenvConfig[$keyval[0]] = $val
|
| 154 |
+
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
return $pyvenvConfig
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
<# Begin Activate script --------------------------------------------------- #>
|
| 163 |
+
|
| 164 |
+
# Determine the containing directory of this script
|
| 165 |
+
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
| 166 |
+
$VenvExecDir = Get-Item -Path $VenvExecPath
|
| 167 |
+
|
| 168 |
+
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
|
| 169 |
+
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
|
| 170 |
+
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
|
| 171 |
+
|
| 172 |
+
# Set values required in priority: CmdLine, ConfigFile, Default
|
| 173 |
+
# First, get the location of the virtual environment, it might not be
|
| 174 |
+
# VenvExecDir if specified on the command line.
|
| 175 |
+
if ($VenvDir) {
|
| 176 |
+
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
|
| 177 |
+
}
|
| 178 |
+
else {
|
| 179 |
+
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
|
| 180 |
+
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
|
| 181 |
+
Write-Verbose "VenvDir=$VenvDir"
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
# Next, read the `pyvenv.cfg` file to determine any required value such
|
| 185 |
+
# as `prompt`.
|
| 186 |
+
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
|
| 187 |
+
|
| 188 |
+
# Next, set the prompt from the command line, or the config file, or
|
| 189 |
+
# just use the name of the virtual environment folder.
|
| 190 |
+
if ($Prompt) {
|
| 191 |
+
Write-Verbose "Prompt specified as argument, using '$Prompt'"
|
| 192 |
+
}
|
| 193 |
+
else {
|
| 194 |
+
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
|
| 195 |
+
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
|
| 196 |
+
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
|
| 197 |
+
$Prompt = $pyvenvCfg['prompt'];
|
| 198 |
+
}
|
| 199 |
+
else {
|
| 200 |
+
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
|
| 201 |
+
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
|
| 202 |
+
$Prompt = Split-Path -Path $venvDir -Leaf
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
Write-Verbose "Prompt = '$Prompt'"
|
| 207 |
+
Write-Verbose "VenvDir='$VenvDir'"
|
| 208 |
+
|
| 209 |
+
# Deactivate any currently active virtual environment, but leave the
|
| 210 |
+
# deactivate function in place.
|
| 211 |
+
deactivate -nondestructive
|
| 212 |
+
|
| 213 |
+
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
|
| 214 |
+
# that there is an activated venv.
|
| 215 |
+
$env:VIRTUAL_ENV = $VenvDir
|
| 216 |
+
|
| 217 |
+
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
| 218 |
+
|
| 219 |
+
Write-Verbose "Setting prompt to '$Prompt'"
|
| 220 |
+
|
| 221 |
+
# Set the prompt to include the env name
|
| 222 |
+
# Make sure _OLD_VIRTUAL_PROMPT is global
|
| 223 |
+
function global:_OLD_VIRTUAL_PROMPT { "" }
|
| 224 |
+
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
|
| 225 |
+
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
|
| 226 |
+
|
| 227 |
+
function global:prompt {
|
| 228 |
+
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
|
| 229 |
+
_OLD_VIRTUAL_PROMPT
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
# Clear PYTHONHOME
|
| 234 |
+
if (Test-Path -Path Env:PYTHONHOME) {
|
| 235 |
+
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
|
| 236 |
+
Remove-Item -Path Env:PYTHONHOME
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
# Add the venv to the PATH
|
| 240 |
+
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
|
| 241 |
+
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
|
project 5/.venv/bin/activate
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
if [ ! "${1:-}" = "nondestructive" ] ; then
|
| 32 |
+
# Self destruct!
|
| 33 |
+
unset -f deactivate
|
| 34 |
+
fi
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
# unset irrelevant variables
|
| 38 |
+
deactivate nondestructive
|
| 39 |
+
|
| 40 |
+
VIRTUAL_ENV="/Users/devkaran/Downloads/project 5/.venv"
|
| 41 |
+
export VIRTUAL_ENV
|
| 42 |
+
|
| 43 |
+
_OLD_VIRTUAL_PATH="$PATH"
|
| 44 |
+
PATH="$VIRTUAL_ENV/bin:$PATH"
|
| 45 |
+
export PATH
|
| 46 |
+
|
| 47 |
+
# unset PYTHONHOME if set
|
| 48 |
+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
| 49 |
+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
| 50 |
+
if [ -n "${PYTHONHOME:-}" ] ; then
|
| 51 |
+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
| 52 |
+
unset PYTHONHOME
|
| 53 |
+
fi
|
| 54 |
+
|
| 55 |
+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
| 56 |
+
_OLD_VIRTUAL_PS1="${PS1:-}"
|
| 57 |
+
PS1="(.venv) ${PS1:-}"
|
| 58 |
+
export PS1
|
| 59 |
+
fi
|
| 60 |
+
|
| 61 |
+
# This should detect bash and zsh, which have a hash command that must
|
| 62 |
+
# be called to get it to forget past commands. Without forgetting
|
| 63 |
+
# past commands the $PATH changes we made may not be respected
|
| 64 |
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
| 65 |
+
hash -r 2> /dev/null
|
| 66 |
+
fi
|
project 5/.venv/bin/activate.csh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 <davidedb@gmail.com>.
|
| 4 |
+
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
|
| 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; test "\!:*" != "nondestructive" && unalias deactivate'
|
| 7 |
+
|
| 8 |
+
# Unset irrelevant variables.
|
| 9 |
+
deactivate nondestructive
|
| 10 |
+
|
| 11 |
+
setenv VIRTUAL_ENV "/Users/devkaran/Downloads/project 5/.venv"
|
| 12 |
+
|
| 13 |
+
set _OLD_VIRTUAL_PATH="$PATH"
|
| 14 |
+
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
set _OLD_VIRTUAL_PROMPT="$prompt"
|
| 18 |
+
|
| 19 |
+
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
|
| 20 |
+
set prompt = "(.venv) $prompt"
|
| 21 |
+
endif
|
| 22 |
+
|
| 23 |
+
alias pydoc python -m pydoc
|
| 24 |
+
|
| 25 |
+
rehash
|
project 5/.venv/bin/activate.fish
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
if test "$argv[1]" != "nondestructive"
|
| 24 |
+
# Self-destruct!
|
| 25 |
+
functions -e deactivate
|
| 26 |
+
end
|
| 27 |
+
end
|
| 28 |
+
|
| 29 |
+
# Unset irrelevant variables.
|
| 30 |
+
deactivate nondestructive
|
| 31 |
+
|
| 32 |
+
set -gx VIRTUAL_ENV "/Users/devkaran/Downloads/project 5/.venv"
|
| 33 |
+
|
| 34 |
+
set -gx _OLD_VIRTUAL_PATH $PATH
|
| 35 |
+
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
| 36 |
+
|
| 37 |
+
# Unset PYTHONHOME if set.
|
| 38 |
+
if set -q PYTHONHOME
|
| 39 |
+
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
|
| 40 |
+
set -e PYTHONHOME
|
| 41 |
+
end
|
| 42 |
+
|
| 43 |
+
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
|
| 44 |
+
# fish uses a function instead of an env var to generate the prompt.
|
| 45 |
+
|
| 46 |
+
# Save the current fish_prompt function as the function _old_fish_prompt.
|
| 47 |
+
functions -c fish_prompt _old_fish_prompt
|
| 48 |
+
|
| 49 |
+
# With the original prompt function renamed, we can override with our own.
|
| 50 |
+
function fish_prompt
|
| 51 |
+
# Save the return status of the last command.
|
| 52 |
+
set -l old_status $status
|
| 53 |
+
|
| 54 |
+
# Output the venv prompt; color taken from the blue of the Python logo.
|
| 55 |
+
printf "%s%s%s" (set_color 4B8BBE) "(.venv) " (set_color normal)
|
| 56 |
+
|
| 57 |
+
# Restore the return status of the previous command.
|
| 58 |
+
echo "exit $old_status" | .
|
| 59 |
+
# Output the original/"old" prompt.
|
| 60 |
+
_old_fish_prompt
|
| 61 |
+
end
|
| 62 |
+
|
| 63 |
+
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
|
| 64 |
+
end
|
project 5/.venv/bin/flask
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from flask.cli import main
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(main())
|
project 5/.venv/bin/normalizer
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from charset_normalizer.cli import cli_detect
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(cli_detect())
|
project 5/.venv/bin/pip
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
# -*- coding: utf-8 -*-
|
| 5 |
+
import re
|
| 6 |
+
import sys
|
| 7 |
+
from pip._internal.cli.main import main
|
| 8 |
+
if __name__ == '__main__':
|
| 9 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
| 10 |
+
sys.exit(main())
|
project 5/.venv/bin/pip3
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
# -*- coding: utf-8 -*-
|
| 5 |
+
import re
|
| 6 |
+
import sys
|
| 7 |
+
from pip._internal.cli.main import main
|
| 8 |
+
if __name__ == '__main__':
|
| 9 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
| 10 |
+
sys.exit(main())
|
project 5/.venv/bin/pip3.9
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
# -*- coding: utf-8 -*-
|
| 5 |
+
import re
|
| 6 |
+
import sys
|
| 7 |
+
from pip._internal.cli.main import main
|
| 8 |
+
if __name__ == '__main__':
|
| 9 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
| 10 |
+
sys.exit(main())
|
project 5/.venv/bin/pyrsa-decrypt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.cli import decrypt
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(decrypt())
|
project 5/.venv/bin/pyrsa-encrypt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.cli import encrypt
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(encrypt())
|
project 5/.venv/bin/pyrsa-keygen
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.cli import keygen
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(keygen())
|
project 5/.venv/bin/pyrsa-priv2pub
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.util import private_to_public
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(private_to_public())
|
project 5/.venv/bin/pyrsa-sign
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.cli import sign
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(sign())
|
project 5/.venv/bin/pyrsa-verify
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from rsa.cli import verify
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(verify())
|
project 5/.venv/bin/tqdm
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
'''exec' "/Users/devkaran/Downloads/project 5/.venv/bin/python" "$0" "$@"
|
| 3 |
+
' '''
|
| 4 |
+
import sys
|
| 5 |
+
from tqdm.cli import main
|
| 6 |
+
if __name__ == '__main__':
|
| 7 |
+
if sys.argv[0].endswith('.exe'):
|
| 8 |
+
sys.argv[0] = sys.argv[0][:-4]
|
| 9 |
+
sys.exit(main())
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (C) 2016 Cory Dolphin, Olin College
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 4 |
+
|
| 5 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 6 |
+
|
| 7 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: Flask-Cors
|
| 3 |
+
Version: 4.0.0
|
| 4 |
+
Summary: A Flask extension adding a decorator for CORS support
|
| 5 |
+
Home-page: https://github.com/corydolphin/flask-cors
|
| 6 |
+
Author: Cory Dolphin
|
| 7 |
+
Author-email: corydolphin@gmail.com
|
| 8 |
+
License: MIT
|
| 9 |
+
Platform: any
|
| 10 |
+
Classifier: Environment :: Web Environment
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 13 |
+
Classifier: Operating System :: OS Independent
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 19 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 20 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 21 |
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
| 22 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 23 |
+
License-File: LICENSE
|
| 24 |
+
Requires-Dist: Flask (>=0.9)
|
| 25 |
+
|
| 26 |
+
Flask-CORS
|
| 27 |
+
==========
|
| 28 |
+
|
| 29 |
+
|Build Status| |Latest Version| |Supported Python versions|
|
| 30 |
+
|License|
|
| 31 |
+
|
| 32 |
+
A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.
|
| 33 |
+
|
| 34 |
+
This package has a simple philosophy: when you want to enable CORS, you wish to enable it for all use cases on a domain.
|
| 35 |
+
This means no mucking around with different allowed headers, methods, etc.
|
| 36 |
+
|
| 37 |
+
By default, submission of cookies across domains is disabled due to the security implications.
|
| 38 |
+
Please see the documentation for how to enable credential'ed requests, and please make sure you add some sort of `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__ protection before doing so!
|
| 39 |
+
|
| 40 |
+
Installation
|
| 41 |
+
------------
|
| 42 |
+
|
| 43 |
+
Install the extension with using pip, or easy\_install.
|
| 44 |
+
|
| 45 |
+
.. code:: bash
|
| 46 |
+
|
| 47 |
+
$ pip install -U flask-cors
|
| 48 |
+
|
| 49 |
+
Usage
|
| 50 |
+
-----
|
| 51 |
+
|
| 52 |
+
This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods.
|
| 53 |
+
It allows parameterization of all CORS headers on a per-resource level.
|
| 54 |
+
The package also contains a decorator, for those who prefer this approach.
|
| 55 |
+
|
| 56 |
+
Simple Usage
|
| 57 |
+
~~~~~~~~~~~~
|
| 58 |
+
|
| 59 |
+
In the simplest case, initialize the Flask-Cors extension with default arguments in order to allow CORS for all domains on all routes.
|
| 60 |
+
See the full list of options in the `documentation <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
|
| 61 |
+
|
| 62 |
+
.. code:: python
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
from flask import Flask
|
| 66 |
+
from flask_cors import CORS
|
| 67 |
+
|
| 68 |
+
app = Flask(__name__)
|
| 69 |
+
CORS(app)
|
| 70 |
+
|
| 71 |
+
@app.route("/")
|
| 72 |
+
def helloWorld():
|
| 73 |
+
return "Hello, cross-origin-world!"
|
| 74 |
+
|
| 75 |
+
Resource specific CORS
|
| 76 |
+
^^^^^^^^^^^^^^^^^^^^^^
|
| 77 |
+
|
| 78 |
+
Alternatively, you can specify CORS options on a resource and origin level of granularity by passing a dictionary as the `resources` option, mapping paths to a set of options.
|
| 79 |
+
See the full list of options in the `documentation <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
|
| 80 |
+
|
| 81 |
+
.. code:: python
|
| 82 |
+
|
| 83 |
+
app = Flask(__name__)
|
| 84 |
+
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
|
| 85 |
+
|
| 86 |
+
@app.route("/api/v1/users")
|
| 87 |
+
def list_users():
|
| 88 |
+
return "user example"
|
| 89 |
+
|
| 90 |
+
Route specific CORS via decorator
|
| 91 |
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 92 |
+
|
| 93 |
+
This extension also exposes a simple decorator to decorate flask routes with.
|
| 94 |
+
Simply add ``@cross_origin()`` below a call to Flask's ``@app.route(..)`` to allow CORS on a given route.
|
| 95 |
+
See the full list of options in the `decorator documentation <https://flask-cors.corydolphin.com/en/latest/api.html#decorator>`__.
|
| 96 |
+
|
| 97 |
+
.. code:: python
|
| 98 |
+
|
| 99 |
+
@app.route("/")
|
| 100 |
+
@cross_origin()
|
| 101 |
+
def helloWorld():
|
| 102 |
+
return "Hello, cross-origin-world!"
|
| 103 |
+
|
| 104 |
+
Documentation
|
| 105 |
+
-------------
|
| 106 |
+
|
| 107 |
+
For a full list of options, please see the full `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
|
| 108 |
+
|
| 109 |
+
Troubleshooting
|
| 110 |
+
---------------
|
| 111 |
+
|
| 112 |
+
If things aren't working as you expect, enable logging to help understand what is going on under the hood, and why.
|
| 113 |
+
|
| 114 |
+
.. code:: python
|
| 115 |
+
|
| 116 |
+
logging.getLogger('flask_cors').level = logging.DEBUG
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
Tests
|
| 120 |
+
-----
|
| 121 |
+
|
| 122 |
+
A simple set of tests is included in ``test/``.
|
| 123 |
+
To run, install nose, and simply invoke ``nosetests`` or ``python setup.py test`` to exercise the tests.
|
| 124 |
+
|
| 125 |
+
If nosetests does not work for you, due to it no longer working with newer python versions.
|
| 126 |
+
You can use pytest to run the tests instead.
|
| 127 |
+
|
| 128 |
+
Contributing
|
| 129 |
+
------------
|
| 130 |
+
|
| 131 |
+
Questions, comments or improvements?
|
| 132 |
+
Please create an issue on `Github <https://github.com/corydolphin/flask-cors>`__, tweet at `@corydolphin <https://twitter.com/corydolphin>`__ or send me an email.
|
| 133 |
+
I do my best to include every contribution proposed in any way that I can.
|
| 134 |
+
|
| 135 |
+
Credits
|
| 136 |
+
-------
|
| 137 |
+
|
| 138 |
+
This Flask extension is based upon the `Decorator for the HTTP Access Control <https://web.archive.org/web/20190128010149/http://flask.pocoo.org/snippets/56/>`__ written by Armin Ronacher.
|
| 139 |
+
|
| 140 |
+
.. |Build Status| image:: https://api.travis-ci.org/corydolphin/flask-cors.svg?branch=master
|
| 141 |
+
:target: https://travis-ci.org/corydolphin/flask-cors
|
| 142 |
+
.. |Latest Version| image:: https://img.shields.io/pypi/v/Flask-Cors.svg
|
| 143 |
+
:target: https://pypi.python.org/pypi/Flask-Cors/
|
| 144 |
+
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/Flask-Cors.svg
|
| 145 |
+
:target: https://img.shields.io/pypi/pyversions/Flask-Cors.svg
|
| 146 |
+
.. |License| image:: http://img.shields.io/:license-mit-blue.svg
|
| 147 |
+
:target: https://pypi.python.org/pypi/Flask-Cors/
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/flask_cors/__init__.cpython-39.pyc,,
|
| 2 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/flask_cors/core.cpython-39.pyc,,
|
| 3 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/flask_cors/decorator.cpython-39.pyc,,
|
| 4 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/flask_cors/extension.cpython-39.pyc,,
|
| 5 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/flask_cors/version.cpython-39.pyc,,
|
| 6 |
+
Flask_Cors-4.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 7 |
+
Flask_Cors-4.0.0.dist-info/LICENSE,sha256=bhob3FSDTB4HQMvOXV9vLK4chG_Sp_SCsRZJWU-vvV0,1069
|
| 8 |
+
Flask_Cors-4.0.0.dist-info/METADATA,sha256=iien2vLs6EIqceJgaNEJ6FPinwfjzFWSNl7XOkuyc10,5419
|
| 9 |
+
Flask_Cors-4.0.0.dist-info/RECORD,,
|
| 10 |
+
Flask_Cors-4.0.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 11 |
+
Flask_Cors-4.0.0.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
|
| 12 |
+
Flask_Cors-4.0.0.dist-info/top_level.txt,sha256=aWye_0QNZPp_QtPF4ZluLHqnyVLT9CPJsfiGhwqkWuo,11
|
| 13 |
+
flask_cors/__init__.py,sha256=wZDCvPTHspA2g1VV7KyKN7R-uCdBnirTlsCzgPDcQtI,792
|
| 14 |
+
flask_cors/core.py,sha256=e1u_o5SOcS_gMWGjcQrkyk91uPICnzZ3AXZvy5jQ_FE,14063
|
| 15 |
+
flask_cors/decorator.py,sha256=BeJsyX1wYhVKWN04FAhb6z8YqffiRr7wKqwzHPap4bw,5009
|
| 16 |
+
flask_cors/extension.py,sha256=nP4Zq_BhgDVWwPdIl_f-uucNxD38pXUo-dkL-voXc58,7832
|
| 17 |
+
flask_cors/version.py,sha256=61rJjfThnbRdElpSP2tm31hPmFnHJmcwoPhtqA0Bi_Q,22
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/REQUESTED
ADDED
|
File without changes
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.40.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py2-none-any
|
| 5 |
+
Tag: py3-none-any
|
| 6 |
+
|
project 5/.venv/lib/python3.9/site-packages/Flask_Cors-4.0.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
flask_cors
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2010 Pallets
|
| 2 |
+
|
| 3 |
+
Redistribution and use in source and binary forms, with or without
|
| 4 |
+
modification, are permitted provided that the following conditions are
|
| 5 |
+
met:
|
| 6 |
+
|
| 7 |
+
1. Redistributions of source code must retain the above copyright
|
| 8 |
+
notice, this list of conditions and the following disclaimer.
|
| 9 |
+
|
| 10 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 11 |
+
notice, this list of conditions and the following disclaimer in the
|
| 12 |
+
documentation and/or other materials provided with the distribution.
|
| 13 |
+
|
| 14 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 15 |
+
contributors may be used to endorse or promote products derived from
|
| 16 |
+
this software without specific prior written permission.
|
| 17 |
+
|
| 18 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 19 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 20 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
| 21 |
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 22 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 23 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
| 24 |
+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
| 25 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
| 26 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
| 27 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
| 28 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: MarkupSafe
|
| 3 |
+
Version: 3.0.2
|
| 4 |
+
Summary: Safely add untrusted strings to HTML/XML markup.
|
| 5 |
+
Maintainer-email: Pallets <contact@palletsprojects.com>
|
| 6 |
+
License: Copyright 2010 Pallets
|
| 7 |
+
|
| 8 |
+
Redistribution and use in source and binary forms, with or without
|
| 9 |
+
modification, are permitted provided that the following conditions are
|
| 10 |
+
met:
|
| 11 |
+
|
| 12 |
+
1. Redistributions of source code must retain the above copyright
|
| 13 |
+
notice, this list of conditions and the following disclaimer.
|
| 14 |
+
|
| 15 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 16 |
+
notice, this list of conditions and the following disclaimer in the
|
| 17 |
+
documentation and/or other materials provided with the distribution.
|
| 18 |
+
|
| 19 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 20 |
+
contributors may be used to endorse or promote products derived from
|
| 21 |
+
this software without specific prior written permission.
|
| 22 |
+
|
| 23 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 24 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 25 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
| 26 |
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 27 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 28 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
| 29 |
+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
| 30 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
| 31 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
| 32 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
| 33 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 34 |
+
|
| 35 |
+
Project-URL: Donate, https://palletsprojects.com/donate
|
| 36 |
+
Project-URL: Documentation, https://markupsafe.palletsprojects.com/
|
| 37 |
+
Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/
|
| 38 |
+
Project-URL: Source, https://github.com/pallets/markupsafe/
|
| 39 |
+
Project-URL: Chat, https://discord.gg/pallets
|
| 40 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 41 |
+
Classifier: Environment :: Web Environment
|
| 42 |
+
Classifier: Intended Audience :: Developers
|
| 43 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 44 |
+
Classifier: Operating System :: OS Independent
|
| 45 |
+
Classifier: Programming Language :: Python
|
| 46 |
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
| 47 |
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
| 48 |
+
Classifier: Typing :: Typed
|
| 49 |
+
Requires-Python: >=3.9
|
| 50 |
+
Description-Content-Type: text/markdown
|
| 51 |
+
License-File: LICENSE.txt
|
| 52 |
+
|
| 53 |
+
# MarkupSafe
|
| 54 |
+
|
| 55 |
+
MarkupSafe implements a text object that escapes characters so it is
|
| 56 |
+
safe to use in HTML and XML. Characters that have special meanings are
|
| 57 |
+
replaced so that they display as the actual characters. This mitigates
|
| 58 |
+
injection attacks, meaning untrusted user input can safely be displayed
|
| 59 |
+
on a page.
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
## Examples
|
| 63 |
+
|
| 64 |
+
```pycon
|
| 65 |
+
>>> from markupsafe import Markup, escape
|
| 66 |
+
|
| 67 |
+
>>> # escape replaces special characters and wraps in Markup
|
| 68 |
+
>>> escape("<script>alert(document.cookie);</script>")
|
| 69 |
+
Markup('<script>alert(document.cookie);</script>')
|
| 70 |
+
|
| 71 |
+
>>> # wrap in Markup to mark text "safe" and prevent escaping
|
| 72 |
+
>>> Markup("<strong>Hello</strong>")
|
| 73 |
+
Markup('<strong>hello</strong>')
|
| 74 |
+
|
| 75 |
+
>>> escape(Markup("<strong>Hello</strong>"))
|
| 76 |
+
Markup('<strong>hello</strong>')
|
| 77 |
+
|
| 78 |
+
>>> # Markup is a str subclass
|
| 79 |
+
>>> # methods and operators escape their arguments
|
| 80 |
+
>>> template = Markup("Hello <em>{name}</em>")
|
| 81 |
+
>>> template.format(name='"World"')
|
| 82 |
+
Markup('Hello <em>"World"</em>')
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## Donate
|
| 86 |
+
|
| 87 |
+
The Pallets organization develops and supports MarkupSafe and other
|
| 88 |
+
popular packages. In order to grow the community of contributors and
|
| 89 |
+
users, and allow the maintainers to devote more time to the projects,
|
| 90 |
+
[please donate today][].
|
| 91 |
+
|
| 92 |
+
[please donate today]: https://palletsprojects.com/donate
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/markupsafe/__init__.cpython-39.pyc,,
|
| 2 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/markupsafe/_native.cpython-39.pyc,,
|
| 3 |
+
MarkupSafe-3.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 4 |
+
MarkupSafe-3.0.2.dist-info/LICENSE.txt,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475
|
| 5 |
+
MarkupSafe-3.0.2.dist-info/METADATA,sha256=aAwbZhSmXdfFuMM-rEHpeiHRkBOGESyVLJIuwzHP-nw,3975
|
| 6 |
+
MarkupSafe-3.0.2.dist-info/RECORD,,
|
| 7 |
+
MarkupSafe-3.0.2.dist-info/WHEEL,sha256=qPSLW7RKkSazFLr9GqnCq82B2cy1OopxhNJnY83fx9k,107
|
| 8 |
+
MarkupSafe-3.0.2.dist-info/top_level.txt,sha256=qy0Plje5IJuvsCBjejJyhDCjEAdcDLK_2agVcex8Z6U,11
|
| 9 |
+
markupsafe/__init__.py,sha256=sr-U6_27DfaSrj5jnHYxWN-pvhM27sjlDplMDPZKm7k,13214
|
| 10 |
+
markupsafe/_native.py,sha256=hSLs8Jmz5aqayuengJJ3kdT5PwNpBWpKrmQSdipndC8,210
|
| 11 |
+
markupsafe/_speedups.c,sha256=O7XulmTo-epI6n2FtMVOrJXl8EAaIwD2iNYmBI5SEoQ,4149
|
| 12 |
+
markupsafe/_speedups.cpython-39-darwin.so,sha256=3kO9hwZrfNqylESEkM3jZAKLiK1u2xcJVWykvvGgimk,50688
|
| 13 |
+
markupsafe/_speedups.pyi,sha256=ENd1bYe7gbBUf2ywyYWOGUpnXOHNJ-cgTNqetlW8h5k,41
|
| 14 |
+
markupsafe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (75.2.0)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp39-cp39-macosx_11_0_arm64
|
| 5 |
+
|
project 5/.venv/lib/python3.9/site-packages/MarkupSafe-3.0.2.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
markupsafe
|
project 5/.venv/lib/python3.9/site-packages/_distutils_hack/__init__.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import os
|
| 3 |
+
import re
|
| 4 |
+
import importlib
|
| 5 |
+
import warnings
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
is_pypy = '__pypy__' in sys.builtin_module_names
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
warnings.filterwarnings('ignore',
|
| 12 |
+
r'.+ distutils\b.+ deprecated',
|
| 13 |
+
DeprecationWarning)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def warn_distutils_present():
|
| 17 |
+
if 'distutils' not in sys.modules:
|
| 18 |
+
return
|
| 19 |
+
if is_pypy and sys.version_info < (3, 7):
|
| 20 |
+
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
|
| 21 |
+
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
|
| 22 |
+
return
|
| 23 |
+
warnings.warn(
|
| 24 |
+
"Distutils was imported before Setuptools, but importing Setuptools "
|
| 25 |
+
"also replaces the `distutils` module in `sys.modules`. This may lead "
|
| 26 |
+
"to undesirable behaviors or errors. To avoid these issues, avoid "
|
| 27 |
+
"using distutils directly, ensure that setuptools is installed in the "
|
| 28 |
+
"traditional way (e.g. not an editable install), and/or make sure "
|
| 29 |
+
"that setuptools is always imported before distutils.")
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def clear_distutils():
|
| 33 |
+
if 'distutils' not in sys.modules:
|
| 34 |
+
return
|
| 35 |
+
warnings.warn("Setuptools is replacing distutils.")
|
| 36 |
+
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
|
| 37 |
+
for name in mods:
|
| 38 |
+
del sys.modules[name]
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def enabled():
|
| 42 |
+
"""
|
| 43 |
+
Allow selection of distutils by environment variable.
|
| 44 |
+
"""
|
| 45 |
+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
|
| 46 |
+
return which == 'local'
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def ensure_local_distutils():
|
| 50 |
+
clear_distutils()
|
| 51 |
+
distutils = importlib.import_module('setuptools._distutils')
|
| 52 |
+
distutils.__name__ = 'distutils'
|
| 53 |
+
sys.modules['distutils'] = distutils
|
| 54 |
+
|
| 55 |
+
# sanity check that submodules load as expected
|
| 56 |
+
core = importlib.import_module('distutils.core')
|
| 57 |
+
assert '_distutils' in core.__file__, core.__file__
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def do_override():
|
| 61 |
+
"""
|
| 62 |
+
Ensure that the local copy of distutils is preferred over stdlib.
|
| 63 |
+
|
| 64 |
+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
|
| 65 |
+
for more motivation.
|
| 66 |
+
"""
|
| 67 |
+
if enabled():
|
| 68 |
+
warn_distutils_present()
|
| 69 |
+
ensure_local_distutils()
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
class DistutilsMetaFinder:
|
| 73 |
+
def find_spec(self, fullname, path, target=None):
|
| 74 |
+
if path is not None:
|
| 75 |
+
return
|
| 76 |
+
|
| 77 |
+
method_name = 'spec_for_{fullname}'.format(**locals())
|
| 78 |
+
method = getattr(self, method_name, lambda: None)
|
| 79 |
+
return method()
|
| 80 |
+
|
| 81 |
+
def spec_for_distutils(self):
|
| 82 |
+
import importlib.abc
|
| 83 |
+
import importlib.util
|
| 84 |
+
|
| 85 |
+
class DistutilsLoader(importlib.abc.Loader):
|
| 86 |
+
|
| 87 |
+
def create_module(self, spec):
|
| 88 |
+
return importlib.import_module('setuptools._distutils')
|
| 89 |
+
|
| 90 |
+
def exec_module(self, module):
|
| 91 |
+
pass
|
| 92 |
+
|
| 93 |
+
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
|
| 94 |
+
|
| 95 |
+
def spec_for_pip(self):
|
| 96 |
+
"""
|
| 97 |
+
Ensure stdlib distutils when running under pip.
|
| 98 |
+
See pypa/pip#8761 for rationale.
|
| 99 |
+
"""
|
| 100 |
+
if self.pip_imported_during_build():
|
| 101 |
+
return
|
| 102 |
+
clear_distutils()
|
| 103 |
+
self.spec_for_distutils = lambda: None
|
| 104 |
+
|
| 105 |
+
@staticmethod
|
| 106 |
+
def pip_imported_during_build():
|
| 107 |
+
"""
|
| 108 |
+
Detect if pip is being imported in a build script. Ref #2355.
|
| 109 |
+
"""
|
| 110 |
+
import traceback
|
| 111 |
+
return any(
|
| 112 |
+
frame.f_globals['__file__'].endswith('setup.py')
|
| 113 |
+
for frame, line in traceback.walk_stack(None)
|
| 114 |
+
)
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
DISTUTILS_FINDER = DistutilsMetaFinder()
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def add_shim():
|
| 121 |
+
sys.meta_path.insert(0, DISTUTILS_FINDER)
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def remove_shim():
|
| 125 |
+
try:
|
| 126 |
+
sys.meta_path.remove(DISTUTILS_FINDER)
|
| 127 |
+
except ValueError:
|
| 128 |
+
pass
|
project 5/.venv/lib/python3.9/site-packages/_distutils_hack/override.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__import__('_distutils_hack').do_override()
|
project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2010 Jason Kirtland
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a
|
| 4 |
+
copy of this software and associated documentation files (the
|
| 5 |
+
"Software"), to deal in the Software without restriction, including
|
| 6 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 8 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 9 |
+
the following conditions:
|
| 10 |
+
|
| 11 |
+
The above copyright notice and this permission notice shall be included
|
| 12 |
+
in all copies or substantial portions of the Software.
|
| 13 |
+
|
| 14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 15 |
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 17 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 18 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 19 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 20 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.3
|
| 2 |
+
Name: blinker
|
| 3 |
+
Version: 1.9.0
|
| 4 |
+
Summary: Fast, simple object-to-object and broadcast signaling
|
| 5 |
+
Author: Jason Kirtland
|
| 6 |
+
Maintainer-email: Pallets Ecosystem <contact@palletsprojects.com>
|
| 7 |
+
Requires-Python: >=3.9
|
| 8 |
+
Description-Content-Type: text/markdown
|
| 9 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 10 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 11 |
+
Classifier: Programming Language :: Python
|
| 12 |
+
Classifier: Typing :: Typed
|
| 13 |
+
Project-URL: Chat, https://discord.gg/pallets
|
| 14 |
+
Project-URL: Documentation, https://blinker.readthedocs.io
|
| 15 |
+
Project-URL: Source, https://github.com/pallets-eco/blinker/
|
| 16 |
+
|
| 17 |
+
# Blinker
|
| 18 |
+
|
| 19 |
+
Blinker provides a fast dispatching system that allows any number of
|
| 20 |
+
interested parties to subscribe to events, or "signals".
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
## Pallets Community Ecosystem
|
| 24 |
+
|
| 25 |
+
> [!IMPORTANT]\
|
| 26 |
+
> This project is part of the Pallets Community Ecosystem. Pallets is the open
|
| 27 |
+
> source organization that maintains Flask; Pallets-Eco enables community
|
| 28 |
+
> maintenance of related projects. If you are interested in helping maintain
|
| 29 |
+
> this project, please reach out on [the Pallets Discord server][discord].
|
| 30 |
+
>
|
| 31 |
+
> [discord]: https://discord.gg/pallets
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Example
|
| 35 |
+
|
| 36 |
+
Signal receivers can subscribe to specific senders or receive signals
|
| 37 |
+
sent by any sender.
|
| 38 |
+
|
| 39 |
+
```pycon
|
| 40 |
+
>>> from blinker import signal
|
| 41 |
+
>>> started = signal('round-started')
|
| 42 |
+
>>> def each(round):
|
| 43 |
+
... print(f"Round {round}")
|
| 44 |
+
...
|
| 45 |
+
>>> started.connect(each)
|
| 46 |
+
|
| 47 |
+
>>> def round_two(round):
|
| 48 |
+
... print("This is round two.")
|
| 49 |
+
...
|
| 50 |
+
>>> started.connect(round_two, sender=2)
|
| 51 |
+
|
| 52 |
+
>>> for round in range(1, 4):
|
| 53 |
+
... started.send(round)
|
| 54 |
+
...
|
| 55 |
+
Round 1!
|
| 56 |
+
Round 2!
|
| 57 |
+
This is round two.
|
| 58 |
+
Round 3!
|
| 59 |
+
```
|
| 60 |
+
|
project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/blinker/__init__.cpython-39.pyc,,
|
| 2 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/blinker/_utilities.cpython-39.pyc,,
|
| 3 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/blinker/base.cpython-39.pyc,,
|
| 4 |
+
blinker-1.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 5 |
+
blinker-1.9.0.dist-info/LICENSE.txt,sha256=nrc6HzhZekqhcCXSrhvjg5Ykx5XphdTw6Xac4p-spGc,1054
|
| 6 |
+
blinker-1.9.0.dist-info/METADATA,sha256=uIRiM8wjjbHkCtbCyTvctU37IAZk0kEe5kxAld1dvzA,1633
|
| 7 |
+
blinker-1.9.0.dist-info/RECORD,,
|
| 8 |
+
blinker-1.9.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
| 9 |
+
blinker/__init__.py,sha256=I2EdZqpy4LyjX17Hn1yzJGWCjeLaVaPzsMgHkLfj_cQ,317
|
| 10 |
+
blinker/_utilities.py,sha256=0J7eeXXTUx0Ivf8asfpx0ycVkp0Eqfqnj117x2mYX9E,1675
|
| 11 |
+
blinker/base.py,sha256=QpDuvXXcwJF49lUBcH5BiST46Rz9wSG7VW_p7N_027M,19132
|
| 12 |
+
blinker/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
project 5/.venv/lib/python3.9/site-packages/blinker-1.9.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.10.1
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
project 5/.venv/lib/python3.9/site-packages/blinker/__init__.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from .base import ANY
|
| 4 |
+
from .base import default_namespace
|
| 5 |
+
from .base import NamedSignal
|
| 6 |
+
from .base import Namespace
|
| 7 |
+
from .base import Signal
|
| 8 |
+
from .base import signal
|
| 9 |
+
|
| 10 |
+
__all__ = [
|
| 11 |
+
"ANY",
|
| 12 |
+
"default_namespace",
|
| 13 |
+
"NamedSignal",
|
| 14 |
+
"Namespace",
|
| 15 |
+
"Signal",
|
| 16 |
+
"signal",
|
| 17 |
+
]
|
project 5/.venv/lib/python3.9/site-packages/blinker/_utilities.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import collections.abc as c
|
| 4 |
+
import inspect
|
| 5 |
+
import typing as t
|
| 6 |
+
from weakref import ref
|
| 7 |
+
from weakref import WeakMethod
|
| 8 |
+
|
| 9 |
+
T = t.TypeVar("T")
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class Symbol:
|
| 13 |
+
"""A constant symbol, nicer than ``object()``. Repeated calls return the
|
| 14 |
+
same instance.
|
| 15 |
+
|
| 16 |
+
>>> Symbol('foo') is Symbol('foo')
|
| 17 |
+
True
|
| 18 |
+
>>> Symbol('foo')
|
| 19 |
+
foo
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
symbols: t.ClassVar[dict[str, Symbol]] = {}
|
| 23 |
+
|
| 24 |
+
def __new__(cls, name: str) -> Symbol:
|
| 25 |
+
if name in cls.symbols:
|
| 26 |
+
return cls.symbols[name]
|
| 27 |
+
|
| 28 |
+
obj = super().__new__(cls)
|
| 29 |
+
cls.symbols[name] = obj
|
| 30 |
+
return obj
|
| 31 |
+
|
| 32 |
+
def __init__(self, name: str) -> None:
|
| 33 |
+
self.name = name
|
| 34 |
+
|
| 35 |
+
def __repr__(self) -> str:
|
| 36 |
+
return self.name
|
| 37 |
+
|
| 38 |
+
def __getnewargs__(self) -> tuple[t.Any, ...]:
|
| 39 |
+
return (self.name,)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def make_id(obj: object) -> c.Hashable:
|
| 43 |
+
"""Get a stable identifier for a receiver or sender, to be used as a dict
|
| 44 |
+
key or in a set.
|
| 45 |
+
"""
|
| 46 |
+
if inspect.ismethod(obj):
|
| 47 |
+
# The id of a bound method is not stable, but the id of the unbound
|
| 48 |
+
# function and instance are.
|
| 49 |
+
return id(obj.__func__), id(obj.__self__)
|
| 50 |
+
|
| 51 |
+
if isinstance(obj, (str, int)):
|
| 52 |
+
# Instances with the same value always compare equal and have the same
|
| 53 |
+
# hash, even if the id may change.
|
| 54 |
+
return obj
|
| 55 |
+
|
| 56 |
+
# Assume other types are not hashable but will always be the same instance.
|
| 57 |
+
return id(obj)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def make_ref(obj: T, callback: c.Callable[[ref[T]], None] | None = None) -> ref[T]:
|
| 61 |
+
if inspect.ismethod(obj):
|
| 62 |
+
return WeakMethod(obj, callback) # type: ignore[arg-type, return-value]
|
| 63 |
+
|
| 64 |
+
return ref(obj, callback)
|
project 5/.venv/lib/python3.9/site-packages/blinker/base.py
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import collections.abc as c
|
| 4 |
+
import sys
|
| 5 |
+
import typing as t
|
| 6 |
+
import weakref
|
| 7 |
+
from collections import defaultdict
|
| 8 |
+
from contextlib import contextmanager
|
| 9 |
+
from functools import cached_property
|
| 10 |
+
from inspect import iscoroutinefunction
|
| 11 |
+
|
| 12 |
+
from ._utilities import make_id
|
| 13 |
+
from ._utilities import make_ref
|
| 14 |
+
from ._utilities import Symbol
|
| 15 |
+
|
| 16 |
+
F = t.TypeVar("F", bound=c.Callable[..., t.Any])
|
| 17 |
+
|
| 18 |
+
ANY = Symbol("ANY")
|
| 19 |
+
"""Symbol for "any sender"."""
|
| 20 |
+
|
| 21 |
+
ANY_ID = 0
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class Signal:
|
| 25 |
+
"""A notification emitter.
|
| 26 |
+
|
| 27 |
+
:param doc: The docstring for the signal.
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
ANY = ANY
|
| 31 |
+
"""An alias for the :data:`~blinker.ANY` sender symbol."""
|
| 32 |
+
|
| 33 |
+
set_class: type[set[t.Any]] = set
|
| 34 |
+
"""The set class to use for tracking connected receivers and senders.
|
| 35 |
+
Python's ``set`` is unordered. If receivers must be dispatched in the order
|
| 36 |
+
they were connected, an ordered set implementation can be used.
|
| 37 |
+
|
| 38 |
+
.. versionadded:: 1.7
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
@cached_property
|
| 42 |
+
def receiver_connected(self) -> Signal:
|
| 43 |
+
"""Emitted at the end of each :meth:`connect` call.
|
| 44 |
+
|
| 45 |
+
The signal sender is the signal instance, and the :meth:`connect`
|
| 46 |
+
arguments are passed through: ``receiver``, ``sender``, and ``weak``.
|
| 47 |
+
|
| 48 |
+
.. versionadded:: 1.2
|
| 49 |
+
"""
|
| 50 |
+
return Signal(doc="Emitted after a receiver connects.")
|
| 51 |
+
|
| 52 |
+
@cached_property
|
| 53 |
+
def receiver_disconnected(self) -> Signal:
|
| 54 |
+
"""Emitted at the end of each :meth:`disconnect` call.
|
| 55 |
+
|
| 56 |
+
The sender is the signal instance, and the :meth:`disconnect` arguments
|
| 57 |
+
are passed through: ``receiver`` and ``sender``.
|
| 58 |
+
|
| 59 |
+
This signal is emitted **only** when :meth:`disconnect` is called
|
| 60 |
+
explicitly. This signal cannot be emitted by an automatic disconnect
|
| 61 |
+
when a weakly referenced receiver or sender goes out of scope, as the
|
| 62 |
+
instance is no longer be available to be used as the sender for this
|
| 63 |
+
signal.
|
| 64 |
+
|
| 65 |
+
An alternative approach is available by subscribing to
|
| 66 |
+
:attr:`receiver_connected` and setting up a custom weakref cleanup
|
| 67 |
+
callback on weak receivers and senders.
|
| 68 |
+
|
| 69 |
+
.. versionadded:: 1.2
|
| 70 |
+
"""
|
| 71 |
+
return Signal(doc="Emitted after a receiver disconnects.")
|
| 72 |
+
|
| 73 |
+
def __init__(self, doc: str | None = None) -> None:
|
| 74 |
+
if doc:
|
| 75 |
+
self.__doc__ = doc
|
| 76 |
+
|
| 77 |
+
self.receivers: dict[
|
| 78 |
+
t.Any, weakref.ref[c.Callable[..., t.Any]] | c.Callable[..., t.Any]
|
| 79 |
+
] = {}
|
| 80 |
+
"""The map of connected receivers. Useful to quickly check if any
|
| 81 |
+
receivers are connected to the signal: ``if s.receivers:``. The
|
| 82 |
+
structure and data is not part of the public API, but checking its
|
| 83 |
+
boolean value is.
|
| 84 |
+
"""
|
| 85 |
+
|
| 86 |
+
self.is_muted: bool = False
|
| 87 |
+
self._by_receiver: dict[t.Any, set[t.Any]] = defaultdict(self.set_class)
|
| 88 |
+
self._by_sender: dict[t.Any, set[t.Any]] = defaultdict(self.set_class)
|
| 89 |
+
self._weak_senders: dict[t.Any, weakref.ref[t.Any]] = {}
|
| 90 |
+
|
| 91 |
+
def connect(self, receiver: F, sender: t.Any = ANY, weak: bool = True) -> F:
|
| 92 |
+
"""Connect ``receiver`` to be called when the signal is sent by
|
| 93 |
+
``sender``.
|
| 94 |
+
|
| 95 |
+
:param receiver: The callable to call when :meth:`send` is called with
|
| 96 |
+
the given ``sender``, passing ``sender`` as a positional argument
|
| 97 |
+
along with any extra keyword arguments.
|
| 98 |
+
:param sender: Any object or :data:`ANY`. ``receiver`` will only be
|
| 99 |
+
called when :meth:`send` is called with this sender. If ``ANY``, the
|
| 100 |
+
receiver will be called for any sender. A receiver may be connected
|
| 101 |
+
to multiple senders by calling :meth:`connect` multiple times.
|
| 102 |
+
:param weak: Track the receiver with a :mod:`weakref`. The receiver will
|
| 103 |
+
be automatically disconnected when it is garbage collected. When
|
| 104 |
+
connecting a receiver defined within a function, set to ``False``,
|
| 105 |
+
otherwise it will be disconnected when the function scope ends.
|
| 106 |
+
"""
|
| 107 |
+
receiver_id = make_id(receiver)
|
| 108 |
+
sender_id = ANY_ID if sender is ANY else make_id(sender)
|
| 109 |
+
|
| 110 |
+
if weak:
|
| 111 |
+
self.receivers[receiver_id] = make_ref(
|
| 112 |
+
receiver, self._make_cleanup_receiver(receiver_id)
|
| 113 |
+
)
|
| 114 |
+
else:
|
| 115 |
+
self.receivers[receiver_id] = receiver
|
| 116 |
+
|
| 117 |
+
self._by_sender[sender_id].add(receiver_id)
|
| 118 |
+
self._by_receiver[receiver_id].add(sender_id)
|
| 119 |
+
|
| 120 |
+
if sender is not ANY and sender_id not in self._weak_senders:
|
| 121 |
+
# store a cleanup for weakref-able senders
|
| 122 |
+
try:
|
| 123 |
+
self._weak_senders[sender_id] = make_ref(
|
| 124 |
+
sender, self._make_cleanup_sender(sender_id)
|
| 125 |
+
)
|
| 126 |
+
except TypeError:
|
| 127 |
+
pass
|
| 128 |
+
|
| 129 |
+
if "receiver_connected" in self.__dict__ and self.receiver_connected.receivers:
|
| 130 |
+
try:
|
| 131 |
+
self.receiver_connected.send(
|
| 132 |
+
self, receiver=receiver, sender=sender, weak=weak
|
| 133 |
+
)
|
| 134 |
+
except TypeError:
|
| 135 |
+
# TODO no explanation or test for this
|
| 136 |
+
self.disconnect(receiver, sender)
|
| 137 |
+
raise
|
| 138 |
+
|
| 139 |
+
return receiver
|
| 140 |
+
|
| 141 |
+
def connect_via(self, sender: t.Any, weak: bool = False) -> c.Callable[[F], F]:
|
| 142 |
+
"""Connect the decorated function to be called when the signal is sent
|
| 143 |
+
by ``sender``.
|
| 144 |
+
|
| 145 |
+
The decorated function will be called when :meth:`send` is called with
|
| 146 |
+
the given ``sender``, passing ``sender`` as a positional argument along
|
| 147 |
+
with any extra keyword arguments.
|
| 148 |
+
|
| 149 |
+
:param sender: Any object or :data:`ANY`. ``receiver`` will only be
|
| 150 |
+
called when :meth:`send` is called with this sender. If ``ANY``, the
|
| 151 |
+
receiver will be called for any sender. A receiver may be connected
|
| 152 |
+
to multiple senders by calling :meth:`connect` multiple times.
|
| 153 |
+
:param weak: Track the receiver with a :mod:`weakref`. The receiver will
|
| 154 |
+
be automatically disconnected when it is garbage collected. When
|
| 155 |
+
connecting a receiver defined within a function, set to ``False``,
|
| 156 |
+
otherwise it will be disconnected when the function scope ends.=
|
| 157 |
+
|
| 158 |
+
.. versionadded:: 1.1
|
| 159 |
+
"""
|
| 160 |
+
|
| 161 |
+
def decorator(fn: F) -> F:
|
| 162 |
+
self.connect(fn, sender, weak)
|
| 163 |
+
return fn
|
| 164 |
+
|
| 165 |
+
return decorator
|
| 166 |
+
|
| 167 |
+
@contextmanager
|
| 168 |
+
def connected_to(
|
| 169 |
+
self, receiver: c.Callable[..., t.Any], sender: t.Any = ANY
|
| 170 |
+
) -> c.Generator[None, None, None]:
|
| 171 |
+
"""A context manager that temporarily connects ``receiver`` to the
|
| 172 |
+
signal while a ``with`` block executes. When the block exits, the
|
| 173 |
+
receiver is disconnected. Useful for tests.
|
| 174 |
+
|
| 175 |
+
:param receiver: The callable to call when :meth:`send` is called with
|
| 176 |
+
the given ``sender``, passing ``sender`` as a positional argument
|
| 177 |
+
along with any extra keyword arguments.
|
| 178 |
+
:param sender: Any object or :data:`ANY`. ``receiver`` will only be
|
| 179 |
+
called when :meth:`send` is called with this sender. If ``ANY``, the
|
| 180 |
+
receiver will be called for any sender.
|
| 181 |
+
|
| 182 |
+
.. versionadded:: 1.1
|
| 183 |
+
"""
|
| 184 |
+
self.connect(receiver, sender=sender, weak=False)
|
| 185 |
+
|
| 186 |
+
try:
|
| 187 |
+
yield None
|
| 188 |
+
finally:
|
| 189 |
+
self.disconnect(receiver)
|
| 190 |
+
|
| 191 |
+
@contextmanager
|
| 192 |
+
def muted(self) -> c.Generator[None, None, None]:
|
| 193 |
+
"""A context manager that temporarily disables the signal. No receivers
|
| 194 |
+
will be called if the signal is sent, until the ``with`` block exits.
|
| 195 |
+
Useful for tests.
|
| 196 |
+
"""
|
| 197 |
+
self.is_muted = True
|
| 198 |
+
|
| 199 |
+
try:
|
| 200 |
+
yield None
|
| 201 |
+
finally:
|
| 202 |
+
self.is_muted = False
|
| 203 |
+
|
| 204 |
+
def send(
|
| 205 |
+
self,
|
| 206 |
+
sender: t.Any | None = None,
|
| 207 |
+
/,
|
| 208 |
+
*,
|
| 209 |
+
_async_wrapper: c.Callable[
|
| 210 |
+
[c.Callable[..., c.Coroutine[t.Any, t.Any, t.Any]]], c.Callable[..., t.Any]
|
| 211 |
+
]
|
| 212 |
+
| None = None,
|
| 213 |
+
**kwargs: t.Any,
|
| 214 |
+
) -> list[tuple[c.Callable[..., t.Any], t.Any]]:
|
| 215 |
+
"""Call all receivers that are connected to the given ``sender``
|
| 216 |
+
or :data:`ANY`. Each receiver is called with ``sender`` as a positional
|
| 217 |
+
argument along with any extra keyword arguments. Return a list of
|
| 218 |
+
``(receiver, return value)`` tuples.
|
| 219 |
+
|
| 220 |
+
The order receivers are called is undefined, but can be influenced by
|
| 221 |
+
setting :attr:`set_class`.
|
| 222 |
+
|
| 223 |
+
If a receiver raises an exception, that exception will propagate up.
|
| 224 |
+
This makes debugging straightforward, with an assumption that correctly
|
| 225 |
+
implemented receivers will not raise.
|
| 226 |
+
|
| 227 |
+
:param sender: Call receivers connected to this sender, in addition to
|
| 228 |
+
those connected to :data:`ANY`.
|
| 229 |
+
:param _async_wrapper: Will be called on any receivers that are async
|
| 230 |
+
coroutines to turn them into sync callables. For example, could run
|
| 231 |
+
the receiver with an event loop.
|
| 232 |
+
:param kwargs: Extra keyword arguments to pass to each receiver.
|
| 233 |
+
|
| 234 |
+
.. versionchanged:: 1.7
|
| 235 |
+
Added the ``_async_wrapper`` argument.
|
| 236 |
+
"""
|
| 237 |
+
if self.is_muted:
|
| 238 |
+
return []
|
| 239 |
+
|
| 240 |
+
results = []
|
| 241 |
+
|
| 242 |
+
for receiver in self.receivers_for(sender):
|
| 243 |
+
if iscoroutinefunction(receiver):
|
| 244 |
+
if _async_wrapper is None:
|
| 245 |
+
raise RuntimeError("Cannot send to a coroutine function.")
|
| 246 |
+
|
| 247 |
+
result = _async_wrapper(receiver)(sender, **kwargs)
|
| 248 |
+
else:
|
| 249 |
+
result = receiver(sender, **kwargs)
|
| 250 |
+
|
| 251 |
+
results.append((receiver, result))
|
| 252 |
+
|
| 253 |
+
return results
|
| 254 |
+
|
| 255 |
+
async def send_async(
|
| 256 |
+
self,
|
| 257 |
+
sender: t.Any | None = None,
|
| 258 |
+
/,
|
| 259 |
+
*,
|
| 260 |
+
_sync_wrapper: c.Callable[
|
| 261 |
+
[c.Callable[..., t.Any]], c.Callable[..., c.Coroutine[t.Any, t.Any, t.Any]]
|
| 262 |
+
]
|
| 263 |
+
| None = None,
|
| 264 |
+
**kwargs: t.Any,
|
| 265 |
+
) -> list[tuple[c.Callable[..., t.Any], t.Any]]:
|
| 266 |
+
"""Await all receivers that are connected to the given ``sender``
|
| 267 |
+
or :data:`ANY`. Each receiver is called with ``sender`` as a positional
|
| 268 |
+
argument along with any extra keyword arguments. Return a list of
|
| 269 |
+
``(receiver, return value)`` tuples.
|
| 270 |
+
|
| 271 |
+
The order receivers are called is undefined, but can be influenced by
|
| 272 |
+
setting :attr:`set_class`.
|
| 273 |
+
|
| 274 |
+
If a receiver raises an exception, that exception will propagate up.
|
| 275 |
+
This makes debugging straightforward, with an assumption that correctly
|
| 276 |
+
implemented receivers will not raise.
|
| 277 |
+
|
| 278 |
+
:param sender: Call receivers connected to this sender, in addition to
|
| 279 |
+
those connected to :data:`ANY`.
|
| 280 |
+
:param _sync_wrapper: Will be called on any receivers that are sync
|
| 281 |
+
callables to turn them into async coroutines. For example,
|
| 282 |
+
could call the receiver in a thread.
|
| 283 |
+
:param kwargs: Extra keyword arguments to pass to each receiver.
|
| 284 |
+
|
| 285 |
+
.. versionadded:: 1.7
|
| 286 |
+
"""
|
| 287 |
+
if self.is_muted:
|
| 288 |
+
return []
|
| 289 |
+
|
| 290 |
+
results = []
|
| 291 |
+
|
| 292 |
+
for receiver in self.receivers_for(sender):
|
| 293 |
+
if not iscoroutinefunction(receiver):
|
| 294 |
+
if _sync_wrapper is None:
|
| 295 |
+
raise RuntimeError("Cannot send to a non-coroutine function.")
|
| 296 |
+
|
| 297 |
+
result = await _sync_wrapper(receiver)(sender, **kwargs)
|
| 298 |
+
else:
|
| 299 |
+
result = await receiver(sender, **kwargs)
|
| 300 |
+
|
| 301 |
+
results.append((receiver, result))
|
| 302 |
+
|
| 303 |
+
return results
|
| 304 |
+
|
| 305 |
+
def has_receivers_for(self, sender: t.Any) -> bool:
|
| 306 |
+
"""Check if there is at least one receiver that will be called with the
|
| 307 |
+
given ``sender``. A receiver connected to :data:`ANY` will always be
|
| 308 |
+
called, regardless of sender. Does not check if weakly referenced
|
| 309 |
+
receivers are still live. See :meth:`receivers_for` for a stronger
|
| 310 |
+
search.
|
| 311 |
+
|
| 312 |
+
:param sender: Check for receivers connected to this sender, in addition
|
| 313 |
+
to those connected to :data:`ANY`.
|
| 314 |
+
"""
|
| 315 |
+
if not self.receivers:
|
| 316 |
+
return False
|
| 317 |
+
|
| 318 |
+
if self._by_sender[ANY_ID]:
|
| 319 |
+
return True
|
| 320 |
+
|
| 321 |
+
if sender is ANY:
|
| 322 |
+
return False
|
| 323 |
+
|
| 324 |
+
return make_id(sender) in self._by_sender
|
| 325 |
+
|
| 326 |
+
def receivers_for(
|
| 327 |
+
self, sender: t.Any
|
| 328 |
+
) -> c.Generator[c.Callable[..., t.Any], None, None]:
|
| 329 |
+
"""Yield each receiver to be called for ``sender``, in addition to those
|
| 330 |
+
to be called for :data:`ANY`. Weakly referenced receivers that are not
|
| 331 |
+
live will be disconnected and skipped.
|
| 332 |
+
|
| 333 |
+
:param sender: Yield receivers connected to this sender, in addition
|
| 334 |
+
to those connected to :data:`ANY`.
|
| 335 |
+
"""
|
| 336 |
+
# TODO: test receivers_for(ANY)
|
| 337 |
+
if not self.receivers:
|
| 338 |
+
return
|
| 339 |
+
|
| 340 |
+
sender_id = make_id(sender)
|
| 341 |
+
|
| 342 |
+
if sender_id in self._by_sender:
|
| 343 |
+
ids = self._by_sender[ANY_ID] | self._by_sender[sender_id]
|
| 344 |
+
else:
|
| 345 |
+
ids = self._by_sender[ANY_ID].copy()
|
| 346 |
+
|
| 347 |
+
for receiver_id in ids:
|
| 348 |
+
receiver = self.receivers.get(receiver_id)
|
| 349 |
+
|
| 350 |
+
if receiver is None:
|
| 351 |
+
continue
|
| 352 |
+
|
| 353 |
+
if isinstance(receiver, weakref.ref):
|
| 354 |
+
strong = receiver()
|
| 355 |
+
|
| 356 |
+
if strong is None:
|
| 357 |
+
self._disconnect(receiver_id, ANY_ID)
|
| 358 |
+
continue
|
| 359 |
+
|
| 360 |
+
yield strong
|
| 361 |
+
else:
|
| 362 |
+
yield receiver
|
| 363 |
+
|
| 364 |
+
def disconnect(self, receiver: c.Callable[..., t.Any], sender: t.Any = ANY) -> None:
|
| 365 |
+
"""Disconnect ``receiver`` from being called when the signal is sent by
|
| 366 |
+
``sender``.
|
| 367 |
+
|
| 368 |
+
:param receiver: A connected receiver callable.
|
| 369 |
+
:param sender: Disconnect from only this sender. By default, disconnect
|
| 370 |
+
from all senders.
|
| 371 |
+
"""
|
| 372 |
+
sender_id: c.Hashable
|
| 373 |
+
|
| 374 |
+
if sender is ANY:
|
| 375 |
+
sender_id = ANY_ID
|
| 376 |
+
else:
|
| 377 |
+
sender_id = make_id(sender)
|
| 378 |
+
|
| 379 |
+
receiver_id = make_id(receiver)
|
| 380 |
+
self._disconnect(receiver_id, sender_id)
|
| 381 |
+
|
| 382 |
+
if (
|
| 383 |
+
"receiver_disconnected" in self.__dict__
|
| 384 |
+
and self.receiver_disconnected.receivers
|
| 385 |
+
):
|
| 386 |
+
self.receiver_disconnected.send(self, receiver=receiver, sender=sender)
|
| 387 |
+
|
| 388 |
+
def _disconnect(self, receiver_id: c.Hashable, sender_id: c.Hashable) -> None:
|
| 389 |
+
if sender_id == ANY_ID:
|
| 390 |
+
if self._by_receiver.pop(receiver_id, None) is not None:
|
| 391 |
+
for bucket in self._by_sender.values():
|
| 392 |
+
bucket.discard(receiver_id)
|
| 393 |
+
|
| 394 |
+
self.receivers.pop(receiver_id, None)
|
| 395 |
+
else:
|
| 396 |
+
self._by_sender[sender_id].discard(receiver_id)
|
| 397 |
+
self._by_receiver[receiver_id].discard(sender_id)
|
| 398 |
+
|
| 399 |
+
def _make_cleanup_receiver(
|
| 400 |
+
self, receiver_id: c.Hashable
|
| 401 |
+
) -> c.Callable[[weakref.ref[c.Callable[..., t.Any]]], None]:
|
| 402 |
+
"""Create a callback function to disconnect a weakly referenced
|
| 403 |
+
receiver when it is garbage collected.
|
| 404 |
+
"""
|
| 405 |
+
|
| 406 |
+
def cleanup(ref: weakref.ref[c.Callable[..., t.Any]]) -> None:
|
| 407 |
+
# If the interpreter is shutting down, disconnecting can result in a
|
| 408 |
+
# weird ignored exception. Don't call it in that case.
|
| 409 |
+
if not sys.is_finalizing():
|
| 410 |
+
self._disconnect(receiver_id, ANY_ID)
|
| 411 |
+
|
| 412 |
+
return cleanup
|
| 413 |
+
|
| 414 |
+
def _make_cleanup_sender(
|
| 415 |
+
self, sender_id: c.Hashable
|
| 416 |
+
) -> c.Callable[[weakref.ref[t.Any]], None]:
|
| 417 |
+
"""Create a callback function to disconnect all receivers for a weakly
|
| 418 |
+
referenced sender when it is garbage collected.
|
| 419 |
+
"""
|
| 420 |
+
assert sender_id != ANY_ID
|
| 421 |
+
|
| 422 |
+
def cleanup(ref: weakref.ref[t.Any]) -> None:
|
| 423 |
+
self._weak_senders.pop(sender_id, None)
|
| 424 |
+
|
| 425 |
+
for receiver_id in self._by_sender.pop(sender_id, ()):
|
| 426 |
+
self._by_receiver[receiver_id].discard(sender_id)
|
| 427 |
+
|
| 428 |
+
return cleanup
|
| 429 |
+
|
| 430 |
+
def _cleanup_bookkeeping(self) -> None:
|
| 431 |
+
"""Prune unused sender/receiver bookkeeping. Not threadsafe.
|
| 432 |
+
|
| 433 |
+
Connecting & disconnecting leaves behind a small amount of bookkeeping
|
| 434 |
+
data. Typical workloads using Blinker, for example in most web apps,
|
| 435 |
+
Flask, CLI scripts, etc., are not adversely affected by this
|
| 436 |
+
bookkeeping.
|
| 437 |
+
|
| 438 |
+
With a long-running process performing dynamic signal routing with high
|
| 439 |
+
volume, e.g. connecting to function closures, senders are all unique
|
| 440 |
+
object instances. Doing all of this over and over may cause memory usage
|
| 441 |
+
to grow due to extraneous bookkeeping. (An empty ``set`` for each stale
|
| 442 |
+
sender/receiver pair.)
|
| 443 |
+
|
| 444 |
+
This method will prune that bookkeeping away, with the caveat that such
|
| 445 |
+
pruning is not threadsafe. The risk is that cleanup of a fully
|
| 446 |
+
disconnected receiver/sender pair occurs while another thread is
|
| 447 |
+
connecting that same pair. If you are in the highly dynamic, unique
|
| 448 |
+
receiver/sender situation that has lead you to this method, that failure
|
| 449 |
+
mode is perhaps not a big deal for you.
|
| 450 |
+
"""
|
| 451 |
+
for mapping in (self._by_sender, self._by_receiver):
|
| 452 |
+
for ident, bucket in list(mapping.items()):
|
| 453 |
+
if not bucket:
|
| 454 |
+
mapping.pop(ident, None)
|
| 455 |
+
|
| 456 |
+
def _clear_state(self) -> None:
|
| 457 |
+
"""Disconnect all receivers and senders. Useful for tests."""
|
| 458 |
+
self._weak_senders.clear()
|
| 459 |
+
self.receivers.clear()
|
| 460 |
+
self._by_sender.clear()
|
| 461 |
+
self._by_receiver.clear()
|
| 462 |
+
|
| 463 |
+
|
| 464 |
+
class NamedSignal(Signal):
|
| 465 |
+
"""A named generic notification emitter. The name is not used by the signal
|
| 466 |
+
itself, but matches the key in the :class:`Namespace` that it belongs to.
|
| 467 |
+
|
| 468 |
+
:param name: The name of the signal within the namespace.
|
| 469 |
+
:param doc: The docstring for the signal.
|
| 470 |
+
"""
|
| 471 |
+
|
| 472 |
+
def __init__(self, name: str, doc: str | None = None) -> None:
|
| 473 |
+
super().__init__(doc)
|
| 474 |
+
|
| 475 |
+
#: The name of this signal.
|
| 476 |
+
self.name: str = name
|
| 477 |
+
|
| 478 |
+
def __repr__(self) -> str:
|
| 479 |
+
base = super().__repr__()
|
| 480 |
+
return f"{base[:-1]}; {self.name!r}>" # noqa: E702
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
class Namespace(dict[str, NamedSignal]):
|
| 484 |
+
"""A dict mapping names to signals."""
|
| 485 |
+
|
| 486 |
+
def signal(self, name: str, doc: str | None = None) -> NamedSignal:
|
| 487 |
+
"""Return the :class:`NamedSignal` for the given ``name``, creating it
|
| 488 |
+
if required. Repeated calls with the same name return the same signal.
|
| 489 |
+
|
| 490 |
+
:param name: The name of the signal.
|
| 491 |
+
:param doc: The docstring of the signal.
|
| 492 |
+
"""
|
| 493 |
+
if name not in self:
|
| 494 |
+
self[name] = NamedSignal(name, doc)
|
| 495 |
+
|
| 496 |
+
return self[name]
|
| 497 |
+
|
| 498 |
+
|
| 499 |
+
class _PNamespaceSignal(t.Protocol):
|
| 500 |
+
def __call__(self, name: str, doc: str | None = None) -> NamedSignal: ...
|
| 501 |
+
|
| 502 |
+
|
| 503 |
+
default_namespace: Namespace = Namespace()
|
| 504 |
+
"""A default :class:`Namespace` for creating named signals. :func:`signal`
|
| 505 |
+
creates a :class:`NamedSignal` in this namespace.
|
| 506 |
+
"""
|
| 507 |
+
|
| 508 |
+
signal: _PNamespaceSignal = default_namespace.signal
|
| 509 |
+
"""Return a :class:`NamedSignal` in :data:`default_namespace` with the given
|
| 510 |
+
``name``, creating it if required. Repeated calls with the same name return the
|
| 511 |
+
same signal.
|
| 512 |
+
"""
|
project 5/.venv/lib/python3.9/site-packages/blinker/py.typed
ADDED
|
File without changes
|
project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-2025 Thomas Kemmer
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 6 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 7 |
+
the Software without restriction, including without limitation the rights to
|
| 8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
| 9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
| 10 |
+
subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
| 17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
| 18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
| 19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
| 20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.2
|
| 2 |
+
Name: cachetools
|
| 3 |
+
Version: 5.5.2
|
| 4 |
+
Summary: Extensible memoizing collections and decorators
|
| 5 |
+
Home-page: https://github.com/tkem/cachetools/
|
| 6 |
+
Author: Thomas Kemmer
|
| 7 |
+
Author-email: tkemmer@computer.org
|
| 8 |
+
License: MIT
|
| 9 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 10 |
+
Classifier: Environment :: Other Environment
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 13 |
+
Classifier: Operating System :: OS Independent
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 23 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 24 |
+
Requires-Python: >=3.7
|
| 25 |
+
License-File: LICENSE
|
| 26 |
+
|
| 27 |
+
cachetools
|
| 28 |
+
========================================================================
|
| 29 |
+
|
| 30 |
+
.. image:: https://img.shields.io/pypi/v/cachetools
|
| 31 |
+
:target: https://pypi.org/project/cachetools/
|
| 32 |
+
:alt: Latest PyPI version
|
| 33 |
+
|
| 34 |
+
.. image:: https://img.shields.io/github/actions/workflow/status/tkem/cachetools/ci.yml
|
| 35 |
+
:target: https://github.com/tkem/cachetools/actions/workflows/ci.yml
|
| 36 |
+
:alt: CI build status
|
| 37 |
+
|
| 38 |
+
.. image:: https://img.shields.io/readthedocs/cachetools
|
| 39 |
+
:target: https://cachetools.readthedocs.io/
|
| 40 |
+
:alt: Documentation build status
|
| 41 |
+
|
| 42 |
+
.. image:: https://img.shields.io/codecov/c/github/tkem/cachetools/master.svg
|
| 43 |
+
:target: https://codecov.io/gh/tkem/cachetools
|
| 44 |
+
:alt: Test coverage
|
| 45 |
+
|
| 46 |
+
.. image:: https://img.shields.io/librariesio/sourcerank/pypi/cachetools
|
| 47 |
+
:target: https://libraries.io/pypi/cachetools
|
| 48 |
+
:alt: Libraries.io SourceRank
|
| 49 |
+
|
| 50 |
+
.. image:: https://img.shields.io/github/license/tkem/cachetools
|
| 51 |
+
:target: https://raw.github.com/tkem/cachetools/master/LICENSE
|
| 52 |
+
:alt: License
|
| 53 |
+
|
| 54 |
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
| 55 |
+
:target: https://github.com/psf/black
|
| 56 |
+
:alt: Code style: black
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
This module provides various memoizing collections and decorators,
|
| 60 |
+
including variants of the Python Standard Library's `@lru_cache`_
|
| 61 |
+
function decorator.
|
| 62 |
+
|
| 63 |
+
.. code-block:: python
|
| 64 |
+
|
| 65 |
+
from cachetools import cached, LRUCache, TTLCache
|
| 66 |
+
|
| 67 |
+
# speed up calculating Fibonacci numbers with dynamic programming
|
| 68 |
+
@cached(cache={})
|
| 69 |
+
def fib(n):
|
| 70 |
+
return n if n < 2 else fib(n - 1) + fib(n - 2)
|
| 71 |
+
|
| 72 |
+
# cache least recently used Python Enhancement Proposals
|
| 73 |
+
@cached(cache=LRUCache(maxsize=32))
|
| 74 |
+
def get_pep(num):
|
| 75 |
+
url = 'http://www.python.org/dev/peps/pep-%04d/' % num
|
| 76 |
+
with urllib.request.urlopen(url) as s:
|
| 77 |
+
return s.read()
|
| 78 |
+
|
| 79 |
+
# cache weather data for no longer than ten minutes
|
| 80 |
+
@cached(cache=TTLCache(maxsize=1024, ttl=600))
|
| 81 |
+
def get_weather(place):
|
| 82 |
+
return owm.weather_at_place(place).get_weather()
|
| 83 |
+
|
| 84 |
+
For the purpose of this module, a *cache* is a mutable_ mapping_ of a
|
| 85 |
+
fixed maximum size. When the cache is full, i.e. by adding another
|
| 86 |
+
item the cache would exceed its maximum size, the cache must choose
|
| 87 |
+
which item(s) to discard based on a suitable `cache algorithm`_.
|
| 88 |
+
|
| 89 |
+
This module provides multiple cache classes based on different cache
|
| 90 |
+
algorithms, as well as decorators for easily memoizing function and
|
| 91 |
+
method calls.
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
Installation
|
| 95 |
+
------------------------------------------------------------------------
|
| 96 |
+
|
| 97 |
+
cachetools is available from PyPI_ and can be installed by running::
|
| 98 |
+
|
| 99 |
+
pip install cachetools
|
| 100 |
+
|
| 101 |
+
Typing stubs for this package are provided by typeshed_ and can be
|
| 102 |
+
installed by running::
|
| 103 |
+
|
| 104 |
+
pip install types-cachetools
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
Project Resources
|
| 108 |
+
------------------------------------------------------------------------
|
| 109 |
+
|
| 110 |
+
- `Documentation`_
|
| 111 |
+
- `Issue tracker`_
|
| 112 |
+
- `Source code`_
|
| 113 |
+
- `Change log`_
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
Related Projects
|
| 117 |
+
------------------------------------------------------------------------
|
| 118 |
+
|
| 119 |
+
- asyncache_: Helpers to use cachetools with async functions
|
| 120 |
+
- cacheing_: Pure Python Cacheing Library
|
| 121 |
+
- CacheToolsUtils_: Cachetools Utilities
|
| 122 |
+
- kids.cache_: Kids caching library
|
| 123 |
+
- shelved-cache_: Persistent cache for Python cachetools
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
License
|
| 127 |
+
------------------------------------------------------------------------
|
| 128 |
+
|
| 129 |
+
Copyright (c) 2014-2025 Thomas Kemmer.
|
| 130 |
+
|
| 131 |
+
Licensed under the `MIT License`_.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
.. _@lru_cache: https://docs.python.org/3/library/functools.html#functools.lru_cache
|
| 135 |
+
.. _mutable: https://docs.python.org/dev/glossary.html#term-mutable
|
| 136 |
+
.. _mapping: https://docs.python.org/dev/glossary.html#term-mapping
|
| 137 |
+
.. _cache algorithm: https://en.wikipedia.org/wiki/Cache_algorithms
|
| 138 |
+
|
| 139 |
+
.. _PyPI: https://pypi.org/project/cachetools/
|
| 140 |
+
.. _typeshed: https://github.com/python/typeshed/
|
| 141 |
+
.. _Documentation: https://cachetools.readthedocs.io/
|
| 142 |
+
.. _Issue tracker: https://github.com/tkem/cachetools/issues/
|
| 143 |
+
.. _Source code: https://github.com/tkem/cachetools/
|
| 144 |
+
.. _Change log: https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst
|
| 145 |
+
.. _MIT License: https://raw.github.com/tkem/cachetools/master/LICENSE
|
| 146 |
+
|
| 147 |
+
.. _asyncache: https://pypi.org/project/asyncache/
|
| 148 |
+
.. _cacheing: https://github.com/breid48/cacheing
|
| 149 |
+
.. _CacheToolsUtils: https://pypi.org/project/CacheToolsUtils/
|
| 150 |
+
.. _kids.cache: https://pypi.org/project/kids.cache/
|
| 151 |
+
.. _shelved-cache: https://pypi.org/project/shelved-cache/
|
project 5/.venv/lib/python3.9/site-packages/cachetools-5.5.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/cachetools/__init__.cpython-39.pyc,,
|
| 2 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/cachetools/_decorators.cpython-39.pyc,,
|
| 3 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/cachetools/func.cpython-39.pyc,,
|
| 4 |
+
../../../../../../Library/Caches/com.apple.python/Users/devkaran/Downloads/project 5/.venv/lib/python3.9/site-packages/cachetools/keys.cpython-39.pyc,,
|
| 5 |
+
cachetools-5.5.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 6 |
+
cachetools-5.5.2.dist-info/LICENSE,sha256=I8Tv96HAJ6l3oLecRJfhdYLDNMXxfvasjKC1LR59hBc,1085
|
| 7 |
+
cachetools-5.5.2.dist-info/METADATA,sha256=YY8fmEiV8he5oa9hC4S6sjLQKrDuoQhx2mQTI7Iqf5Y,5379
|
| 8 |
+
cachetools-5.5.2.dist-info/RECORD,,
|
| 9 |
+
cachetools-5.5.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
| 10 |
+
cachetools-5.5.2.dist-info/top_level.txt,sha256=ai2FH78TGwoBcCgVfoqbzk5IQCtnDukdSs4zKuVPvDs,11
|
| 11 |
+
cachetools/__init__.py,sha256=cutUU6fB1bIMih0ro_TVCPKJTPwM-qP4fS_PyNfQlWs,21803
|
| 12 |
+
cachetools/_decorators.py,sha256=4_u0GL89t2BOLGwnK8CueiFtyHKK2zydoHj9aqnsMM4,3832
|
| 13 |
+
cachetools/func.py,sha256=aOVfSkuNWMRADpkHZGK7LeJ_VZ8wljzbRwIAliOuhAg,3719
|
| 14 |
+
cachetools/keys.py,sha256=AOgfoi-oioBOnEEk115_9qs0HKISrYnbcV4F0hyZ1yk,1777
|